aboutsummaryrefslogtreecommitdiff
path: root/src/api/ContextMenu.ts
diff options
context:
space:
mode:
authorNuckyz <61953774+Nuckyz@users.noreply.github.com>2023-04-12 23:22:38 -0300
committerGitHub <noreply@github.com>2023-04-13 04:22:38 +0200
commite34da54271ed8027d337a484f0ec00749c71a53b (patch)
tree7d0e15f471bf1000ab7eb552350dff8648de0f05 /src/api/ContextMenu.ts
parentcfe41ef656085e3b3ed2e0ac68020b546045b55b (diff)
downloadVencord-e34da54271ed8027d337a484f0ec00749c71a53b.tar.gz
Vencord-e34da54271ed8027d337a484f0ec00749c71a53b.tar.bz2
Vencord-e34da54271ed8027d337a484f0ec00749c71a53b.zip
Option to transform emotes/stickers in compound messages (#876)
+ ContextMenu refactor to not call callbacks for same children multiple times Co-authored-by: V <vendicated@riseup.net>
Diffstat (limited to 'src/api/ContextMenu.ts')
-rw-r--r--src/api/ContextMenu.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/api/ContextMenu.ts b/src/api/ContextMenu.ts
index 16f9f32..4e52131 100644
--- a/src/api/ContextMenu.ts
+++ b/src/api/ContextMenu.ts
@@ -118,7 +118,12 @@ interface ContextMenuProps {
onClose: (callback: (...args: Array<any>) => any) => void;
}
+const patchedMenus = new WeakSet();
+
export function _patchContextMenu(props: ContextMenuProps) {
+ if (patchedMenus.has(props)) return;
+ patchedMenus.add(props);
+
props.contextMenuApiArguments ??= [];
const contextMenuPatches = navPatches.get(props.navId);