Project Information
- Repository: https://github.com/busyorg/busy
- Project Name: Busy
- GitHub Issue: https://github.com/busyorg/busy/issues/2057
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;
})
...