diff --git a/frontend/src/assets/images/favicon-gold.png b/frontend/src/assets/images/favicon-gold.png new file mode 100644 index 000000000..2574ecbef Binary files /dev/null and b/frontend/src/assets/images/favicon-gold.png differ diff --git a/frontend/src/assets/images/favicon.svg b/frontend/src/assets/images/favicon.svg new file mode 100644 index 000000000..4f248bfd5 --- /dev/null +++ b/frontend/src/assets/images/favicon.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/frontend/src/utils/xpack.ts b/frontend/src/utils/xpack.ts index 505f6311d..8901ab466 100644 --- a/frontend/src/utils/xpack.ts +++ b/frontend/src/utils/xpack.ts @@ -18,7 +18,12 @@ export function initFavicon() { const link = (document.querySelector("link[rel*='icon']") || document.createElement('link')) as HTMLLinkElement; link.type = 'image/x-icon'; link.rel = 'shortcut icon'; - link.href = favicon ? '/api/v1/images/favicon' : '/public/favicon.png'; + if (globalStore.isDarkGoldTheme) { + let goldLink = new URL(`../assets/images/favicon-gold.png`, import.meta.url).href; + link.href = favicon ? '/api/v1/images/favicon' : goldLink; + } else { + link.href = favicon ? '/api/v1/images/favicon' : '/public/favicon.png'; + } document.getElementsByTagName('head')[0].appendChild(link); } @@ -29,9 +34,11 @@ export async function getXpackSetting() { searchXSetting = xpackModules['../xpack/api/modules/setting.ts']['searchXSetting'] || {}; const res = await searchXSetting(); if (!res) { + initFavicon(); resetXSetting(); return; } + initFavicon(); return res; } }