move internal state from settings.json to state.json

This commit is contained in:
Vendicated
2024-01-07 02:26:18 +01:00
parent 779c8fa516
commit 4074e8d6ac
8 changed files with 60 additions and 29 deletions

View File

@@ -20,19 +20,22 @@ export interface Settings {
arRPC?: boolean;
appBadge?: boolean;
discordWindowsTitleBar?: boolean;
maximized?: boolean;
minimized?: boolean;
windowBounds?: Rectangle;
disableMinSize?: boolean;
checkUpdates?: boolean;
skippedUpdate?: string;
firstLaunch?: boolean;
splashTheming?: boolean;
splashColor?: string;
splashBackground?: string;
}
export interface State {
maximized?: boolean;
minimized?: boolean;
windowBounds?: Rectangle;
skippedUpdate?: string;
firstLaunch?: boolean;
steamOSLayoutVersion?: number;
}

View File

@@ -144,4 +144,11 @@ export class SettingsStore<T extends object> {
listeners.delete(cb);
if (!listeners.size) this.pathListeners.delete(path as string);
}
/**
* Call all global change listeners
*/
public markAsChanged() {
this.globalListeners.forEach(cb => cb(this.plain, ""));
}
}