Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/gallery-block.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-components/build-style/style.css', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '1eb11fc0b636111ccc4876191f5e87c7');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-components/build-style/style.css', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '95635dcdce3468c638dab46e572af7a3');
2 changes: 1 addition & 1 deletion js/gallery-block.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions js/src/gallery-block/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ const Edit = ( { setAttributes, attributes, className, isSelected } ) => {
const [ loading, setLoading ] = useState( false );

const preparedAttributes = useMemo( () => {
// Do not override block settings with defaults on existing ones.
if ( 0 !== attributes.selectedImages.length ) {
return attributes;
}

const defaultAttrs = {};

// eslint-disable-next-line no-unused-vars
Expand Down