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: Evaluate all callbacks rather than override them #18788

Merged
merged 1 commit into from Oct 31, 2022

Conversation

nattsw
Copy link
Contributor

@nattsw nattsw commented Oct 28, 2022

When we have multiple plugins triggering

api.removePostMenuButton("like", () => x);

the last plugin that makes the call gets to decide if the post menu button is removed or not. This change makes it such that we will evaluate all callbacks rather than just rely on the last one.

Essentially, we ended up with duplicate like buttons when the discourse-upvotes plugin evaluates after discourse-reactions.

Screenshot 2022-10-28 at 7 33 19 PM

Related: https://meta.discourse.org/t/thumbs-up-twice/240867/

@nattsw nattsw force-pushed the multiple-post-menu-button-callbacks branch from 0fd141b to 1a3166a Compare October 28, 2022 11:33
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/thumbs-up-twice/240867/32

@nattsw nattsw force-pushed the multiple-post-menu-button-callbacks branch from 1a3166a to 1edbe26 Compare October 28, 2022 11:44
@nattsw
Copy link
Contributor Author

nattsw commented Oct 28, 2022

Will merge on Monday

@nattsw nattsw merged commit 5e4bad0 into main Oct 31, 2022
@nattsw nattsw deleted the multiple-post-menu-button-callbacks branch October 31, 2022 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants