Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Staging) Edit post button doesn't show the post data in the editor initially #2057

Closed
jrawsthorne opened this issue Jul 10, 2018 · 0 comments
Assignees
Labels

Comments

@jrawsthorne
Copy link
Contributor

Expected behavior

When you click the edit post button the title, body, tags etc... should show in the editor without needing to reload the page.

Actual behavior

The editor is blank until you refresh the page or go to another draft and back again.

How to reproduce

  • Go to edit a post you have made
  • You are taken to the editor page but the title, body, tags etc... are blank.

Recording Of The Bug

Possible solution

Introduced in #2054

This redirects to the editor before the user's metadata has been updated with the new draft

if (redirect) dispatch(push(`/editor?draft=${post.id}`));

The solution would be to redirect once the promise has been fulfilled

promise: addDraftMetadata(post).then(postMetadata => {
          if (redirect) dispatch(push(`/editor?draft=${post.id}`));
          return postMetadata;
        })
...
@Sekhmet Sekhmet self-assigned this Jul 11, 2018
@Sekhmet Sekhmet added the bug label Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants