Skip to content

Commit

Permalink
Preserve isNew after save completes successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed May 26, 2017
1 parent f784d3e commit 4c45d0e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions editor/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default {
dispatch( {
type: 'REQUEST_POST_UPDATE_SUCCESS',
post: newPost,
isNew,
} );
} ).fail( ( err ) => {
dispatch( {
Expand Down
2 changes: 1 addition & 1 deletion editor/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export function saving( state = {}, action ) {
requesting: false,
successful: true,
error: null,
isNew: false,
isNew: action.isNew,
};

case 'REQUEST_POST_UPDATE_FAILURE':
Expand Down
2 changes: 1 addition & 1 deletion editor/test/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ describe( 'state', () => {
requesting: false,
successful: true,
error: null,
isNew: false,
isNew: true,
} );
} );

Expand Down

0 comments on commit 4c45d0e

Please sign in to comment.