Skip to content

Commit

Permalink
redirect to editor after save (#2060)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sekhmet authored Jul 11, 2018
1 parent 0561f7a commit 5b93020
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/client/post/Write/editorActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ export const addEditedPost = createAction(ADD_EDITED_POST);
export const DELETE_EDITED_POST = '@editor/DELETE_EDITED_POST';
export const deleteEditedPost = createAction(DELETE_EDITED_POST);

export const saveDraft = (post, redirect, intl) => dispatch => {
if (redirect) dispatch(push(`/editor?draft=${post.id}`));
return dispatch({
export const saveDraft = (post, redirect, intl) => dispatch =>
dispatch({
type: SAVE_DRAFT,
payload: {
promise: addDraftMetadata(post).catch(err => {
Expand All @@ -54,8 +53,9 @@ export const saveDraft = (post, redirect, intl) => dispatch => {
}),
},
meta: { postId: post.id },
}).then(() => {
if (redirect) dispatch(push(`/editor?draft=${post.id}`));
});
};

export const deleteDraft = draftIds => dispatch =>
dispatch({
Expand Down

0 comments on commit 5b93020

Please sign in to comment.