aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNuckyz <61953774+Nuckyz@users.noreply.github.com>2023-03-08 03:01:15 -0300
committerGitHub <noreply@github.com>2023-03-08 06:01:15 +0000
commit0fb3901a185327f3de39682ea9fc6e809b935807 (patch)
tree70dbbac792390cf1034488c9ad504c3398fd4f48
parent1b199ec5d8e0ca3805a9960323ddd267561b4cf6 (diff)
downloadVencord-0fb3901a185327f3de39682ea9fc6e809b935807.tar.gz
Vencord-0fb3901a185327f3de39682ea9fc6e809b935807.tar.bz2
Vencord-0fb3901a185327f3de39682ea9fc6e809b935807.zip
Fix Context Menu API (#583)
-rw-r--r--src/plugins/apiContextMenu.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/apiContextMenu.ts b/src/plugins/apiContextMenu.ts
index 131c209..77afead 100644
--- a/src/plugins/apiContextMenu.ts
+++ b/src/plugins/apiContextMenu.ts
@@ -22,6 +22,8 @@ import definePlugin from "@utils/types";
import { addListener, removeListener } from "@webpack";
function listener(exports: any, id: number) {
+ if (!Settings.plugins.ContextMenuAPI.enabled) return removeListener(listener);
+
if (typeof exports !== "object" || exports === null) return;
for (const key in exports) if (key.length <= 3) {
@@ -51,7 +53,7 @@ function listener(exports: any, id: number) {
}
}
-if (Settings.plugins.ContextMenuAPI.enabled) addListener(listener);
+addListener(listener);
export default definePlugin({
name: "ContextMenuAPI",