diff --git a/packages/editor/src/store/effects/posts.js b/packages/editor/src/store/effects/posts.js index 9c876fe7b5947b..2da7fac0278198 100644 --- a/packages/editor/src/store/effects/posts.js +++ b/packages/editor/src/store/effects/posts.js @@ -174,16 +174,7 @@ export const requestPostUpdate = async ( action, store ) => { */ export const requestPostUpdateSuccess = ( action, store ) => { const { previousPost, post, isAutosave, postType } = action; - const { dispatch, getState } = store; - - // TEMPORARY: If edits remain after a save completes, the user must be - // prompted about unsaved changes. This should be refactored as part of - // the `isEditedPostDirty` selector instead. - // - // See: https://github.com/WordPress/gutenberg/issues/7409 - if ( Object.keys( getPostEdits( getState() ) ).length ) { - dispatch( { type: 'DIRTY_ARTIFICIALLY' } ); - } + const { dispatch } = store; // Autosaves are neither shown a notice nor redirected. if ( isAutosave ) { diff --git a/packages/editor/src/store/reducer.js b/packages/editor/src/store/reducer.js index 77de903ec63354..2d4dcae788652e 100644 --- a/packages/editor/src/store/reducer.js +++ b/packages/editor/src/store/reducer.js @@ -244,9 +244,6 @@ export const editor = flow( [ return state; - case 'DIRTY_ARTIFICIALLY': - return { ...state }; - case 'UPDATE_POST': case 'RESET_POST': const getCanonicalValue = action.type === 'UPDATE_POST' ? diff --git a/packages/editor/src/store/test/effects.js b/packages/editor/src/store/test/effects.js index 81ca509b85f3b6..b6ff397e649878 100644 --- a/packages/editor/src/store/test/effects.js +++ b/packages/editor/src/store/test/effects.js @@ -331,19 +331,6 @@ describe( 'effects', () => { expect( dispatch ).toHaveBeenCalledTimes( 0 ); } ); - - it( 'should dispatch dirtying action if edits linger after autosave', () => { - const dispatch = jest.fn(); - const store = { dispatch, getState: createGetState( true ) }; - - const previousPost = getPublishedPost(); - const post = { ...getPublishedPost(), id: defaultPost.id + 1 }; - - handler( { post, previousPost, isAutosave: true }, store ); - - expect( dispatch ).toHaveBeenCalledTimes( 1 ); - expect( dispatch ).toHaveBeenCalledWith( { type: 'DIRTY_ARTIFICIALLY' } ); - } ); } ); describe( '.REQUEST_POST_UPDATE_FAILURE', () => {