From c0543586cb77d82517d8481ba7701620f484a333 Mon Sep 17 00:00:00 2001 From: Strencher <46447572+Strencher@users.noreply.github.com> Date: Wed, 12 Oct 2022 22:08:27 +0200 Subject: [PATCH] Fix ContextMenu Patcher --- renderer/src/modules/api/contextmenu.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renderer/src/modules/api/contextmenu.js b/renderer/src/modules/api/contextmenu.js index 9e0bd2c5..4a086b4e 100644 --- a/renderer/src/modules/api/contextmenu.js +++ b/renderer/src/modules/api/contextmenu.js @@ -83,6 +83,7 @@ class MenuPatcher { const proxyFunction = this.subPatches.get(target[method]) ?? (() => { const originalFunction = target[method]; + const depth = ++iteration; function patch() { const res = originalFunction.apply(this, arguments); @@ -95,7 +96,7 @@ class MenuPatcher { const layer = res.props.children ? res.props.children : res; if (typeof layer?.type == "function") { - MenuPatcher.patchRecursive(layer, "type", ++iteration); + MenuPatcher.patchRecursive(layer, "type", depth); } }