Skip to content

Commit a92c711

Browse files
author
Marco Pereirinha
committed
Prevent custom settings to be override by the defaults
1 parent 9de7b2e commit a92c711

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

js/src/gallery-block/edit.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ const Edit = ( { setAttributes, attributes, className, isSelected } ) => {
4141
const [ loading, setLoading ] = useState( false );
4242

4343
const preparedAttributes = useMemo( () => {
44+
// Do not override block settings with defaults on existing ones.
45+
if ( 0 !== attributes.selectedImages.lenght ) {
46+
return attributes;
47+
}
48+
4449
const defaultAttrs = {};
4550

4651
// eslint-disable-next-line no-unused-vars

0 commit comments

Comments
 (0)