From: Dessalines Date: Fri, 17 Jul 2020 19:25:52 +0000 (-0400) Subject: Un-expand image when receiving new post. Fixes #979 (#988) X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/static/%7BpictshareAvatarThumbnail%28?a=commitdiff_plain;h=7fdd41697e2ee975196930de71569f2bdbbd999e;p=lemmy.git Un-expand image when receiving new post. Fixes #979 (#988) --- diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx index 418fe7b4..a47aba99 100644 --- a/ui/src/components/post-listing.tsx +++ b/ui/src/components/post-listing.tsx @@ -101,6 +101,9 @@ export class PostListing extends Component { this.state.upvotes = nextProps.post.upvotes; this.state.downvotes = nextProps.post.downvotes; this.state.score = nextProps.post.score; + if (this.props.post.id !== nextProps.post.id) { + this.state.imageExpanded = false; + } this.setState(this.state); } diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 2bede777..96047765 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -825,6 +825,11 @@ export function editPostRes(data: PostResponse, post: Post) { post.url = data.post.url; post.name = data.post.name; post.nsfw = data.post.nsfw; + post.deleted = data.post.deleted; + post.removed = data.post.removed; + post.stickied = data.post.stickied; + post.body = data.post.body; + post.locked = data.post.locked; } }