aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-10-09 03:01:35 +0200
committerV <vendicated@riseup.net>2023-10-09 03:01:54 +0200
commit377cf600550da9c1b49924bd996fc86be9011048 (patch)
tree79387bc371366fc2229a7d116823fbe3d6de37b7 /src
parent34ac71870529f6fda5abcd98af664012b4f44873 (diff)
downloadVencord-377cf600550da9c1b49924bd996fc86be9011048.tar.gz
Vencord-377cf600550da9c1b49924bd996fc86be9011048.tar.bz2
Vencord-377cf600550da9c1b49924bd996fc86be9011048.zip
fix global settings listeners
Diffstat (limited to 'src')
-rw-r--r--src/api/Settings.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/api/Settings.ts b/src/api/Settings.ts
index c380f63..368f88f 100644
--- a/src/api/Settings.ts
+++ b/src/api/Settings.ts
@@ -237,7 +237,8 @@ type ResolvePropDeep<T, P> = P extends "" ? T :
export function addSettingsListener<Path extends keyof Settings>(path: Path, onUpdate: (newValue: Settings[Path], path: Path) => void): void;
export function addSettingsListener<Path extends string>(path: Path, onUpdate: (newValue: Path extends "" ? any : ResolvePropDeep<Settings, Path>, path: Path extends "" ? string : Path) => void): void;
export function addSettingsListener(path: string, onUpdate: (newValue: any, path: string) => void) {
- ((onUpdate as SubscriptionCallback)._paths ??= []).push(path);
+ if (path)
+ ((onUpdate as SubscriptionCallback)._paths ??= []).push(path);
subscriptions.add(onUpdate);
}