feat(Quick Tags): Natively update posts after editing#1980
feat(Quick Tags): Natively update posts after editing#1980marcustyphoon merged 6 commits intomasterfrom
Conversation
|
Uhhhhhh why the heck does a fetched community post have Meh. I guess either I have to make the util have a whitelist of keys it's supposed to update, or just assume the change went through as we thought and supply it the change. I guess the former is better; if Tumblr's servers transform our changes, we want to reflect that. |
Oh, that's fun: this affects redpop itself; if you edit a community post in the community timeline it temporarily gains the above-header thingy. I guess I'll report that. |
I think it's fine. It's weird when you're used to the previous behaviour, but ignoring that it's not that bad. |
Description
Quick Tags edits posts on the Tumblr servers, but this does not cause the rendered posts on the page to update with the new information. We add a fake tags element to the edited post to simulate this.
This, instead, hooks into the Tumblr front end to cause the post to be rerendered with the up-to-date information. The newly added util fetches the post from the server and calls an internal function used to do this when the user edits a post.
For simplicity and/or out of laziness, I delete the blog object out of the fetched post. I assume we're not going to be making edits to a post that would affect its blog (how would that work?), and this avoids having to test if specific blog info URL parameters are required on the API request so nothing explodes.There is a longer delay than there used to be between submitting a tag edit and having the confirmation appear because we're waiting for two API requests with this. Maybe we should add an in-progress state somehow? Any ideas?
Testing steps
Confirm that adding a tag to a post using Quick Tags causes the tag to appear in the footer of the post, but does not affect the post in any other way: