]> Untitled Git - lemmy.git/commitdiff
Fixing issue with empty crossposts.
authorDessalines <tyhou13@gmx.com>
Mon, 18 May 2020 13:50:05 +0000 (09:50 -0400)
committerDessalines <tyhou13@gmx.com>
Mon, 18 May 2020 13:50:05 +0000 (09:50 -0400)
ui/src/components/post.tsx

index bf3694ba59fa4d2e0443054f3b7754972ea6a909..297d0465a6f89b0cc6cbded8f2b9ca550288d99d 100644 (file)
@@ -457,7 +457,9 @@ export class Post extends Component<any, PostState> {
       this.state.crossPosts = data.posts.filter(
         p => p.id != Number(this.props.match.params.id)
       );
-      this.state.post.duplicates = this.state.crossPosts;
+      if (this.state.crossPosts.length) {
+        this.state.post.duplicates = this.state.crossPosts;
+      }
       this.setState(this.state);
     } else if (res.op == UserOperation.TransferSite) {
       let data = res.data as GetSiteResponse;