Fix system theme pair integration

This commit is contained in:
Yuri Karamian committed 2026-08-06 15:12:43 +02:00
1 parent aeddcc6e58
commit 1950c4cc3c
8 files changed
+73 -52

No files matched your search

+10 -4
View File
@@ -690,9 +690,15 @@
async function removeCustomTheme(ct: CustomTheme) {
try {
await deleteCustomTheme(ct.id);
if (systemLightTheme === ct.id) systemLightTheme = 'light';
if (systemDarkTheme === ct.id) systemDarkTheme = 'dark';
if ($appConfig) {
$appConfig.custom_themes = $appConfig.custom_themes.filter(t => t.id !== ct.id);
$appConfig = { ...$appConfig };
$appConfig = {
...$appConfig,
custom_themes: $appConfig.custom_themes.filter(t => t.id !== ct.id),
system_light_theme: systemLightTheme,
system_dark_theme: systemDarkTheme,
};
}
if ($theme === ct.id) {
$theme = 'system';
@@ -1044,9 +1050,9 @@
}
});
// Re-apply when theme changes
// Re-apply when the concrete theme changes, including an OS appearance switch.
$effect(() => {
const _ = $theme;
const _ = $resolvedTheme;
const preset = accentPresets.find(p => p.name === activeAccent);
if (preset) {
applyAccent(preset);