Set state.entryDraft.entry.hasChanged to false when an entry saves succesfully

This commit is contained in:
Benaiah Mischenko 2017-03-15 23:20:54 -07:00
parent cbcd2f3bca
commit 47c46e7a6a

View File

@ -70,11 +70,16 @@ const entryDraftReducer = (state = Map(), action) => {
case ENTRY_PERSIST_SUCCESS:
case ENTRY_PERSIST_FAILURE:
case UNPUBLISHED_ENTRY_PERSIST_SUCCESS:
case UNPUBLISHED_ENTRY_PERSIST_FAILURE: {
return state.deleteIn(['entry', 'isPersisting']);
}
case UNPUBLISHED_ENTRY_PERSIST_SUCCESS:
return state.withMutations((state) => {
state.deleteIn(['entry', 'isPersisting']);
state.setIn(['entry', 'hasChanged'], false);
});
case ADD_ASSET:
return state.update('mediaFiles', list => list.push(action.payload.public_path));
case REMOVE_ASSET: