Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions web/src/hooks/use-site-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ export function SiteConfigProvider({ children }: { children: ReactNode }) {
attribution_url: data.attribution_url || "https://keygate.app",
loading: false,
})
// Dynamic favicon from custom logo
// Dynamic favicon from custom logo. index.html declares
// multiple <link rel="icon"> variants and browsers pick their
// favorite (often the sizes="32x32" one), so rewriting only
// the first link never visibly changed the tab icon — update
// them all.
if (data.logo_url) {
const link = document.querySelector("link[rel='icon']") as HTMLLinkElement
if (link) link.href = data.logo_url
document.querySelectorAll<HTMLLinkElement>("link[rel~='icon']").forEach((link) => {
link.href = data.logo_url
})
}
if (data.brand_color) {
document.documentElement.style.setProperty("--color-primary", data.brand_color)
Expand Down