Fix showing crosspost dupes. Fixes #900 (#912)

This commit is contained in:
Dessalines 2023-02-02 21:15:36 -05:00 committed by GitHub
parent e03d3c40e6
commit 1dd86fdf91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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) {