diff --git a/packages/editor/src/store/selectors.js b/packages/editor/src/store/selectors.js index 783a0ee72d39af..81fa98f7fab2fc 100644 --- a/packages/editor/src/store/selectors.js +++ b/packages/editor/src/store/selectors.js @@ -2100,7 +2100,7 @@ export function isPostLocked( state ) { * @return {boolean} Is locked. */ export function isPostSavingLocked( state ) { - return state.postSavingLock.length > 0; + return Object.keys( state.postSavingLock ).length > 0; } /** diff --git a/packages/editor/src/store/test/selectors.js b/packages/editor/src/store/test/selectors.js index 58a839ff93a471..1470f2261db39c 100644 --- a/packages/editor/src/store/test/selectors.js +++ b/packages/editor/src/store/test/selectors.js @@ -1098,7 +1098,7 @@ describe( 'selectors', () => { describe( 'isPostSavingLocked', () => { it( 'should return true if the post has postSavingLocks', () => { const state = { - postSavingLock: [ { 1: true } ], + postSavingLock: { example: true }, currentPost: {}, saving: {}, }; @@ -1108,7 +1108,7 @@ describe( 'selectors', () => { it( 'should return false if the post has no postSavingLocks', () => { const state = { - postSavingLock: [], + postSavingLock: {}, currentPost: {}, saving: {}, };