]> Untitled Git - lemmy-ui.git/commitdiff
Fix showing crosspost dupes. Fixes #900 (#912)
authorDessalines <dessalines@users.noreply.github.com>
Fri, 3 Feb 2023 02:15:36 +0000 (21:15 -0500)
committerGitHub <noreply@github.com>
Fri, 3 Feb 2023 02:15:36 +0000 (21:15 -0500)
src/shared/components/post/post.tsx

index 8a51f1c7ccc719f8f0108d11f41453190ddc2af5..72a5428458af23a557837eaa5e7bdbb9eb538785 100644 (file)
@@ -754,7 +754,7 @@ export class Post extends Component<any, PostState> {
     } else if (op == UserOperation.Search) {
       let data = wsJsonToRes<SearchResponse>(msg);
       let xPosts = data.posts.filter(
-        p => p.post.id != Number(this.props.match.params.id)
+        p => p.post.ap_id != this.state.postRes?.post_view.post.ap_id
       );
       this.setState({ crossPosts: xPosts.length > 0 ? xPosts : undefined });
     } else if (op == UserOperation.LeaveAdmin) {