From f8adadb8b5378740e8b6f5dc879598c8a7d30222 Mon Sep 17 00:00:00 2001 From: Mario Santos Date: Fri, 12 Jul 2024 14:48:32 +0200 Subject: [PATCH] Remove type from object --- packages/blocks/src/api/test/registration.js | 1 + packages/blocks/src/store/reducer.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/blocks/src/api/test/registration.js b/packages/blocks/src/api/test/registration.js index 7ecbe36c1326dc..9a5786996b6241 100644 --- a/packages/blocks/src/api/test/registration.js +++ b/packages/blocks/src/api/test/registration.js @@ -1627,6 +1627,7 @@ describe( 'blocks', () => { const source = { name: 'core/test-source', label: 'Test Source', + getValue: () => 'value', }; registerBlockBindingsSource( source ); registerBlockBindingsSource( source ); diff --git a/packages/blocks/src/store/reducer.js b/packages/blocks/src/store/reducer.js index f2fd430db12da0..a0793c5c27fe72 100644 --- a/packages/blocks/src/store/reducer.js +++ b/packages/blocks/src/store/reducer.js @@ -374,10 +374,11 @@ export function collections( state = {}, action ) { export function blockBindingsSources( state = {}, action ) { switch ( action.type ) { case 'ADD_BLOCK_BINDINGS_SOURCE': - // Filter the name property and the undefined values. + // Filter the name property, the type property, and the undefined values. const newProperties = Object.fromEntries( Object.entries( action ).filter( - ( [ key, value ] ) => value !== undefined && key !== 'name' + ( [ key, value ] ) => + value !== undefined && key !== 'name' && key !== 'type' ) );