]> Untitled Git - lemmy.git/commitdiff
Un-expand image when receiving new post. Fixes #979 (#988)
authorDessalines <dessalines@users.noreply.github.com>
Fri, 17 Jul 2020 19:25:52 +0000 (15:25 -0400)
committerGitHub <noreply@github.com>
Fri, 17 Jul 2020 19:25:52 +0000 (15:25 -0400)
ui/src/components/post-listing.tsx
ui/src/utils.ts

index 418fe7b486a6c64e301b16f536091a43c23d77ee..a47aba99205175b527233015b694cdce8a552e27 100644 (file)
@@ -101,6 +101,9 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
     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);
   }
 
index 2bede77704aeee5553a48df68453a2ac810ea8ad..960477650d084981eedd56436b5344b5c6573086 100644 (file)
@@ -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;
   }
 }