From e34da54271ed8027d337a484f0ec00749c71a53b Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Wed, 12 Apr 2023 23:22:38 -0300 Subject: Option to transform emotes/stickers in compound messages (#876) + ContextMenu refactor to not call callbacks for same children multiple times Co-authored-by: V --- src/api/ContextMenu.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/api') 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) => 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); -- cgit