diff options
author | Nuckyz <61953774+Nuckyz@users.noreply.github.com> | 2023-03-08 01:59:50 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-08 01:59:50 -0300 |
commit | 1b199ec5d8e0ca3805a9960323ddd267561b4cf6 (patch) | |
tree | ccc2bdc72a70e0c0ca220953fa881af1f52a4751 /src/webpack/patchWebpack.ts | |
parent | 40395d562aeadaeaa88c5bc106797ea5a4ee51e4 (diff) | |
download | Vencord-1b199ec5d8e0ca3805a9960323ddd267561b4cf6.tar.gz Vencord-1b199ec5d8e0ca3805a9960323ddd267561b4cf6.tar.bz2 Vencord-1b199ec5d8e0ca3805a9960323ddd267561b4cf6.zip |
feat: Context Menu API (#496)
Diffstat (limited to 'src/webpack/patchWebpack.ts')
-rw-r--r-- | src/webpack/patchWebpack.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index 19ca951..697ce94 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -92,9 +92,11 @@ function patchPush() { return; } + const numberId = Number(id); + for (const callback of listeners) { try { - callback(exports); + callback(exports, numberId); } catch (err) { logger.error("Error in webpack listener", err); } @@ -104,17 +106,17 @@ function patchPush() { try { if (filter(exports)) { subscriptions.delete(filter); - callback(exports); + callback(exports, numberId); } else if (typeof exports === "object") { if (exports.default && filter(exports.default)) { subscriptions.delete(filter); - callback(exports.default); + callback(exports.default, numberId); } for (const nested in exports) if (nested.length <= 3) { if (exports[nested] && filter(exports[nested])) { subscriptions.delete(filter); - callback(exports[nested]); + callback(exports[nested], numberId); } } } |