From e04ea086dc5b0ae5f18ede09101a10f2962db059 Mon Sep 17 00:00:00 2001 From: ward Date: Mon, 23 Jun 2025 12:26:38 +1200 Subject: [PATCH] Minor fix to color setting --- materialious/src/routes/(app)/+layout.svelte | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/materialious/src/routes/(app)/+layout.svelte b/materialious/src/routes/(app)/+layout.svelte index dbbf4780..fc293ddf 100644 --- a/materialious/src/routes/(app)/+layout.svelte +++ b/materialious/src/routes/(app)/+layout.svelte @@ -173,6 +173,19 @@ onMount(async () => { ui(); + let themeHex = get(themeColorStore); + if (themeHex) { + await ui('theme', themeHex); + } else if (Capacitor.getPlatform() === 'android') { + if (!themeHex) { + try { + const colorPalette = await colorTheme.getColorPalette(); + themeHex = convertToHexColorCode(colorPalette.primary); + await ui('theme', themeHex); + } catch {} + } + } + $isAndroidTvStore = (await androidTv.isAndroidTv()).value; if ($isAndroidTvStore) { @@ -192,19 +205,6 @@ // So user preferences overwrite instance preferences. bookmarkletLoadFromUrl(); - let themeHex = get(themeColorStore); - if (themeHex) { - await ui('theme', themeHex); - } else if (Capacitor.getPlatform() === 'android') { - if (!themeHex) { - try { - const colorPalette = await colorTheme.getColorPalette(); - themeHex = convertToHexColorCode(colorPalette.primary); - await ui('theme', themeHex); - } catch {} - } - } - await setStatusBarColor(); setTheme();