From 3e4e4d179bb9197fd28a839da4e096890fbe8125 Mon Sep 17 00:00:00 2001
From: Lim Chee Aun <cheeaun@gmail.com>
Date: Thu, 21 Dec 2023 22:07:31 +0800
Subject: [PATCH] Test better temp color for refreshing theme-color

---
 src/app.jsx | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/app.jsx b/src/app.jsx
index 3e4a6879..e6136715 100644
--- a/src/app.jsx
+++ b/src/app.jsx
@@ -204,7 +204,16 @@ if (isIOS) {
       );
       const color = $meta?.getAttribute('content');
       if (color) {
-        $meta.content = '';
+        let tempColor;
+        if (/^#/.test(color)) {
+          // Assume either #RBG or #RRGGBB
+          if (color.length === 4) {
+            tempColor = color + 'f';
+          } else if (color.length === 7) {
+            tempColor = color + 'ff';
+          }
+        }
+        $meta.content = tempColor || '';
         setTimeout(() => {
           $meta.content = color;
         }, 10);