Fix Settings not persisting, ooop

This commit is contained in:
Vendicated 2023-04-10 22:30:30 +02:00
parent 897df3a5d4
commit bfb9af05b0
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905

View file

@ -67,7 +67,7 @@ export class SettingsStore<T extends object> {
* Set the data of the store. * Set the data of the store.
* This will update this.store and this.plain (and old references to them will be stale! Avoid storing them in variables) * This will update this.store and this.plain (and old references to them will be stale! Avoid storing them in variables)
* *
* Additionally, all global listeners (or those for pathToNotify, if specified) will be called with the new data * Additionally, all global listeners (and those for pathToNotify, if specified) will be called with the new data
* @param value New data * @param value New data
* @param pathToNotify Optional path to notify instead of globally. Used to transfer path via ipc * @param pathToNotify Optional path to notify instead of globally. Used to transfer path via ipc
*/ */
@ -90,9 +90,9 @@ export class SettingsStore<T extends object> {
} }
this.pathListeners.get(pathToNotify)?.forEach(cb => cb(v)); this.pathListeners.get(pathToNotify)?.forEach(cb => cb(v));
} else {
this.globalListeners.forEach(cb => cb(value, ""));
} }
this.globalListeners.forEach(cb => cb(value, ""));
} }
/** /**