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(plugins/vcDoubleClick): conflict with MessageClickActions #2396

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arHSM
Copy link
Contributor

@arHSM arHSM commented Apr 29, 2024

After enabling both VoiceChatDoucleClick and MessageClickActions, double clicking a voice channel mention in a message would both edit/reply to the message as well as join the voice channel, adding a evt.stopPropagation() fixes this behavior

arHSM and others added 2 commits April 29, 2024 21:48
After anabling both `VoiceChatDoucleClick` and `MessageClickActions`, double clicking a voice channel mention in a message would both edit/reply to the message as well as join the voice channel, adding a `evt.stopPropagation()` fixes this behaviour
@@ -52,7 +52,7 @@ export default definePlugin({
replacement: {
match: /onClick:(\i)(?=,.{0,30}className:"channelMention".+?(\i)\.inContent)/,
replace: (_, onClick, props) => ""
+ `onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${props})&&${onClick}()`,
+ `onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${props})(vcDoubleClickEvt.stopPropagation(),${onClick}())`,
Copy link
Owner

Choose a reason for hiding this comment

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

this looks wrong, shouldn't it be this?

Suggested change
+ `onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${props})(vcDoubleClickEvt.stopPropagation(),${onClick}())`,
+ `onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${props})&&(vcDoubleClickEvt.stopPropagation(),${onClick}())`,

Copy link
Owner

Choose a reason for hiding this comment

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

also it seems the find for this patch is no longer unique and needs updating

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.

None yet

2 participants