Test better temp color for refreshing theme-color

This commit is contained in:
Lim Chee Aun 2023-12-21 22:07:31 +08:00
parent 92d6fe7ebe
commit 3e4e4d179b

View file

@ -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);