mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Check for standalone before using the system theme
This commit is contained in:
parent
fe35220145
commit
d8a8bf7a58
@ -6,10 +6,16 @@ export const THEMES = {
|
|||||||
export let THEME = THEMES.light;
|
export let THEME = THEMES.light;
|
||||||
let currentThemePreference = "light";
|
let currentThemePreference = "light";
|
||||||
|
|
||||||
|
if (G_IS_STANDALONE) {
|
||||||
THEMES.system = THEMES.light;
|
THEMES.system = THEMES.light;
|
||||||
ipcRenderer.on("system-theme-updated", detectSystemTheme);
|
ipcRenderer.on("system-theme-updated", detectSystemTheme);
|
||||||
|
}
|
||||||
|
|
||||||
export function detectSystemTheme() {
|
export function detectSystemTheme() {
|
||||||
|
if (!G_IS_STANDALONE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return ipcRenderer
|
return ipcRenderer
|
||||||
.invoke("get-system-theme")
|
.invoke("get-system-theme")
|
||||||
.then(theme => (THEMES.system = THEMES[theme]))
|
.then(theme => (THEMES.system = THEMES[theme]))
|
||||||
|
@ -291,7 +291,7 @@ class SettingsStorage {
|
|||||||
this.soundVolume = 1.0;
|
this.soundVolume = 1.0;
|
||||||
this.musicVolume = 1.0;
|
this.musicVolume = 1.0;
|
||||||
|
|
||||||
this.theme = "system";
|
this.theme = G_IS_STANDALONE ? "system" : "light";
|
||||||
this.refreshRate = "60";
|
this.refreshRate = "60";
|
||||||
this.scrollWheelSensitivity = "regular";
|
this.scrollWheelSensitivity = "regular";
|
||||||
this.movementSpeed = "regular";
|
this.movementSpeed = "regular";
|
||||||
|
Loading…
Reference in New Issue
Block a user