diff options
Diffstat (limited to 'src/api/ContextMenu.ts')
-rw-r--r-- | src/api/ContextMenu.ts | 5 |
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); |