Add theme validation and update settings.html accordingly
This commit is contained in:
@@ -168,6 +168,7 @@
|
|||||||
if (theme === 'sky') document.body.classList.add('theme-sky');
|
if (theme === 'sky') document.body.classList.add('theme-sky');
|
||||||
if (theme === 'grey') document.body.classList.add('theme-grey');
|
if (theme === 'grey') document.body.classList.add('theme-grey');
|
||||||
};
|
};
|
||||||
|
const VALID_THEMES = ['sky', 'default', 'grey'];
|
||||||
|
|
||||||
// Elemente holen
|
// Elemente holen
|
||||||
const themeSelect = document.getElementById('themeSelect');
|
const themeSelect = document.getElementById('themeSelect');
|
||||||
@@ -195,7 +196,7 @@
|
|||||||
window.electronAPI.getMinutesCommitThreshold()
|
window.electronAPI.getMinutesCommitThreshold()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const fallbackTheme = initialTheme || 'sky';
|
const fallbackTheme = VALID_THEMES.includes(initialTheme) ? initialTheme : 'sky';
|
||||||
themeSelect.value = fallbackTheme;
|
themeSelect.value = fallbackTheme;
|
||||||
applyThemeClass(fallbackTheme);
|
applyThemeClass(fallbackTheme);
|
||||||
// Inputs setzen
|
// Inputs setzen
|
||||||
|
|||||||
Reference in New Issue
Block a user