From d8c65599672a0fb4f67b63b3e7f4226a99a8ed86 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 23 May 2024 23:56:29 -0300 Subject: [PATCH] I forgot this --- src/webpack/patchWebpack.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index 51d0b9a93..4aa468fe8 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -24,7 +24,7 @@ const modulesProxyHandler: ProxyHandler = { [propName, (...args: any[]) => Reflect[propName](...args)] )), get: (target, p) => { - const propValue = Reflect.get(target, p); + const propValue = Reflect.get(target, p, target); // If the property is not a number, we are not dealing with a module factory // $$vencordOriginal means the factory is already patched, $$vencordRequired means it has already been required @@ -36,7 +36,7 @@ const modulesProxyHandler: ProxyHandler = { // This patches factories if eagerPatches are disabled const patchedFactory = patchFactory(p, propValue); - Reflect.set(target, p, patchedFactory); + Reflect.set(target, p, patchedFactory, target); return patchedFactory; }, @@ -44,10 +44,10 @@ const modulesProxyHandler: ProxyHandler = { // $$vencordRequired means we are resetting the factory to its original after being required // If the property is not a number, we are not dealing with a module factory if (!Settings.eagerPatches || newValue?.$$vencordRequired === true || Number.isNaN(Number(p))) { - return Reflect.set(target, p, newValue); + return Reflect.set(target, p, newValue, target); } - const existingFactory = Reflect.get(target, p); + const existingFactory = Reflect.get(target, p, target); // Check if this factory is already patched // @ts-ignore @@ -59,7 +59,7 @@ const modulesProxyHandler: ProxyHandler = { // Modules are only patched once, so we need to set the patched factory on all the modules for (const proxiedModules of allProxiedModules) { - Reflect.set(proxiedModules, p, patchedFactory); + Reflect.set(proxiedModules, p, patchedFactory, proxiedModules); } return true; @@ -328,7 +328,7 @@ function patchFactory(id: PropertyKey, factory: ModuleFactory) { // @ts-ignore originalFactory.$$vencordRequired = true; for (const proxiedModules of allProxiedModules) { - Reflect.set(proxiedModules, id, originalFactory); + Reflect.set(proxiedModules, id, originalFactory, proxiedModules); } if (wreq == null && IS_DEV) {