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: Pin icon should update when pin is toggled in topic lists #13

Merged
merged 1 commit into from
Jan 4, 2022

Conversation

OsamaSayegh
Copy link
Member

@OsamaSayegh OsamaSayegh commented Jan 3, 2022

This component overrides core's method renderTopicListItem which has an @observes decorator for topic.pinned so that the UI updates when the user toggles the pin for a topic in a topics list. However, the method override in this component doesn't apply the same decorator to the override which effectively removes the decorator entirely and that causes the UI not to update when the pin is toggled.

https://github.com/discourse/discourse/blob/810e040f170813fdff9727bf6e145824ad6f14eb/app/assets/javascripts/discourse/app/components/topic-list-item.js#L49-L53

Related meta topic: https://meta.discourse.org/t/cant-pin-unpin-topic-from-the-title/213444?u=osama.

Copy link
Member

@davidtaylorhq davidtaylorhq left a comment

Choose a reason for hiding this comment

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

Oh wow, nice catch - thanks @OsamaSayegh

@davidtaylorhq davidtaylorhq merged commit 0676407 into main Jan 4, 2022
@davidtaylorhq davidtaylorhq deleted the fix/pin-toggle-in-topic-lists branch January 4, 2022 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants