Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix post view crosspost display #1425

Closed
wants to merge 1 commit into from

Conversation

alectrocute
Copy link
Contributor

Hi Lemdevs!

Currently, the crosspost UI is displaying for all posts even if the post isn't crossposted.

I propose we:

  • Filter out all crossposts with the same community ID as the current PostView.
  • If there's a better way to do this, I propose we do that.

Resolves #1394.

Thanks all!

@jsit
Copy link
Contributor

jsit commented Jun 20, 2023

Where is the value of crossPosts coming from? Shouldn't that just be an empty array to begin with? Or is it supposed to be an array of all Communities the link is posted in? Isn't this a new problem? What changed to cause it?

@@ -591,7 +591,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
}

duplicatesLine() {
const dupes = this.props.crossPosts;
const dupes = this.props.crossPosts?.filter(
pv => pv.community.id !== this.postView.community.id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the pv.post.id is better here, because a single post could have some historical cross-posts. For example, a github project might be posted multiple times over the course of a few years.

@dessalines
Copy link
Member

@jsit You're correct, this is also a bug in the back end. I'll get a PR out for that shortly.

@jsit
Copy link
Contributor

jsit commented Jun 21, 2023

You're correct, this is also a bug in the back end. I'll get a PR out for that shortly.

Thanks. Maybe best then, @alectrocute, to add a TODO line explaining that this check can be removed at some point, with a link to this comment.

@dessalines
Copy link
Member

Actually you can probably close this one, I'll have a back-end fix for it shortly anyway.

@dessalines
Copy link
Member

mmk ya I finished the back-end PR, we can close.

@dessalines dessalines closed this Jun 21, 2023
@alectrocute alectrocute deleted the fix-crosspost-issue branch June 21, 2023 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Post shows cross-posting even when it wasn't cross-posted
3 participants