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

Words
125
Reading
1 min
Listen
Play
8y

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

Busy 2.5.1 Bug: Edit post button doesn't show the post data in the ... | Ecency