patches v1.5.2 #100

Merged
jkeffects merged 3 commits from develop into main 2025-05-08 06:22:13 +00:00
Showing only changes of commit 0dbc726f64 - Show all commits

View file

@ -265,9 +265,7 @@ export default abstract class SettingHelper {
* @param oldValue The old value
*/
private static notifyListeners(key: SettingString, newValue: any, oldValue: any): void {
if (!this.listeners.has(key)) return;
const callbacks = this.listeners.get(key)!;
const callbacks = this.listeners.get(key) ?? [];
for (const callback of callbacks) {
try {
callback(newValue, oldValue);
@ -276,7 +274,7 @@ export default abstract class SettingHelper {
}
}
const topicCallbacks = this.topicListeners.get(key.split(".")[0] as SettingTopic)!;
const topicCallbacks = this.topicListeners.get(key.split(".")[0] as SettingTopic) ?? [];
for (const callback of topicCallbacks) {
try {
callback();