From afea5146587364f35501578d2a30a350267744ca Mon Sep 17 00:00:00 2001 From: Eiichi Yoshikawa Date: Wed, 6 Mar 2024 12:06:33 +0900 Subject: [PATCH 1/2] Apply delay for updating `theme-color` meta tag --- src/alf/util/useColorModeTheme.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/alf/util/useColorModeTheme.ts b/src/alf/util/useColorModeTheme.ts index 4f8921bf9b..e727f47622 100644 --- a/src/alf/util/useColorModeTheme.ts +++ b/src/alf/util/useColorModeTheme.ts @@ -49,7 +49,9 @@ function updateDocument(theme: ThemeName) { html.className = html.className.replace(/(theme)--\w+/g, '') html.classList.add(`theme--${theme}`) // set color to 'theme-color' meta tag - meta?.setAttribute('content', getBackgroundColor(theme)) + setTimeout(() => { + meta?.setAttribute('content', getBackgroundColor(theme)) + }, 100) } } From 399e35bd32057fcb8207acbca7a161eb257c8c83 Mon Sep 17 00:00:00 2001 From: Eiichi Yoshikawa Date: Wed, 6 Mar 2024 13:12:36 +0900 Subject: [PATCH 2/2] Increase delay for poor-spec Chromebook --- src/alf/util/useColorModeTheme.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alf/util/useColorModeTheme.ts b/src/alf/util/useColorModeTheme.ts index e727f47622..c0046a2f4c 100644 --- a/src/alf/util/useColorModeTheme.ts +++ b/src/alf/util/useColorModeTheme.ts @@ -51,7 +51,7 @@ function updateDocument(theme: ThemeName) { // set color to 'theme-color' meta tag setTimeout(() => { meta?.setAttribute('content', getBackgroundColor(theme)) - }, 100) + }, 500) } }