diff --git a/packages/editor/src/store/selectors.js b/packages/editor/src/store/selectors.js index a4e426507f8167..8b8f7136ce3dc2 100644 --- a/packages/editor/src/store/selectors.js +++ b/packages/editor/src/store/selectors.js @@ -2056,7 +2056,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 2474cc1e2565f8..4f9e3fa0fd7752 100644 --- a/packages/editor/src/store/test/selectors.js +++ b/packages/editor/src/store/test/selectors.js @@ -964,7 +964,7 @@ describe( 'selectors', () => { describe( 'isPostSavingLocked', () => { it( 'should return true if the post has postSavingLocks', () => { const state = { - postSavingLock: [ { 1: true } ], + postSavingLock: { example: true }, currentPost: {}, saving: {}, }; @@ -974,7 +974,7 @@ describe( 'selectors', () => { it( 'should return false if the post has no postSavingLocks', () => { const state = { - postSavingLock: [], + postSavingLock: {}, currentPost: {}, saving: {}, };