mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
Fix formatting and improve favicon update logic
This commit is contained in:
@@ -344,14 +344,16 @@ export default function Layout({ children }: LayoutProps) {
|
|||||||
|
|
||||||
// Update favicon
|
// Update favicon
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!logoUrl) return
|
if (!logoUrl) return;
|
||||||
|
|
||||||
const link = document.querySelector<HTMLLinkElement>("link[rel*='icon']") || document.createElement('link')
|
const link =
|
||||||
link.type = 'image/x-icon'
|
document.querySelector<HTMLLinkElement>("link[rel*='icon']") ||
|
||||||
link.rel = 'shortcut icon'
|
document.createElement('link');
|
||||||
link.href = logoUrl
|
link.type = 'image/x-icon';
|
||||||
document.getElementsByTagName('head')[0].appendChild(link)
|
link.rel = 'shortcut icon';
|
||||||
}, [logoUrl])
|
link.href = logoUrl;
|
||||||
|
document.getElementsByTagName('head')[0].appendChild(link);
|
||||||
|
}, [logoUrl]);
|
||||||
|
|
||||||
// Fetch contests and polls counts to determine if they should be shown
|
// Fetch contests and polls counts to determine if they should be shown
|
||||||
const { data: contestsCount } = useQuery({
|
const { data: contestsCount } = useQuery({
|
||||||
|
|||||||
Reference in New Issue
Block a user