]> Untitled Git - lemmy-ui.git/commitdiff
fix bug collapsing previews when voting
authorAlec Armbruster <35377827+alectrocute@users.noreply.github.com>
Mon, 26 Jun 2023 13:25:00 +0000 (09:25 -0400)
committerAlec Armbruster <35377827+alectrocute@users.noreply.github.com>
Mon, 26 Jun 2023 13:25:00 +0000 (09:25 -0400)
src/shared/components/post/post-listing.tsx

index 449f69630ad90294abccfc203897aa192ccf4c8a..c423b2cec9066462581b3d83a66456d8db099c99 100644 (file)
@@ -42,6 +42,7 @@ import {
   SavePost,
   TransferCommunity,
 } from "lemmy-js-client";
+import deepEqual from "lodash.isequal";
 import { relTags } from "../../config";
 import {
   BanType,
@@ -168,7 +169,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
   }
 
   componentWillReceiveProps(nextProps: PostListingProps) {
-    if (this.props !== nextProps) {
+    if (!deepEqual(this.props, nextProps)) {
       this.setState({
         purgeLoading: false,
         reportLoading: false,
@@ -183,7 +184,6 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
         addModLoading: false,
         addAdminLoading: false,
         transferLoading: false,
-        imageExpanded: false,
       });
     }
   }