Jake Rawsthorne avatar

Busy 2.5.1 Bug: Edit post button doesn't show the post data in the editor initially

jrawsthorne

Published: 11 Jul 2018 › Updated: 11 Jul 2018Busy 2.5.1 Bug: Edit post button doesn't show the post data in the editor initially

Busy 2.5.1 Bug: Edit post button doesn't show the post data in the editor initially

Project Information

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

  • Visit https://staging.busy.org
  • 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;
        })
...

GitHub Account

https://github.com/jrawsthorne

Leave Busy 2.5.1 Bug: Edit post button doesn't show the post data in the editor initially to:

Written by

Developer, entrepreneur and Utopian contributor

Read more #utopian-io posts


Best Posts From Jake Rawsthorne

We have not curated any of jrawsthorne's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Jake Rawsthorne