feat: refine forum settings uploads and transitions

This commit is contained in:
lezi-fun committed 2026-08-14 10:16:34 +08:00
1 parent e85ced7319
commit f5d173350b
23 files changed
+985 -54

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
export function applyFavicon(url, version = '') {
if (typeof document === 'undefined' || !url) return;
let href = url;
try {
const resolved = new URL(url, window.location.href);
if (version) resolved.searchParams.set('v', version);
href = resolved.href;
} catch {
href = url;
}
let link = document.querySelector('link[rel="icon"]');
if (!link) {
link = document.createElement('link');
link.rel = 'icon';
document.head.appendChild(link);
}
link.href = href;
}