feat(webui): support custom background images (#6674)

This commit is contained in:
chengyongru authored and GitHub committed 2026-11-16 22:08:55 +08:00
1 parent 92d23d2d2b
commit e91906bc3a
29 files changed
+1259 -3

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
import { useEffect, useState } from "react";
export function useObjectUrl(blob: Blob | null): string | null {
const [value, setValue] = useState<{ blob: Blob; url: string } | null>(null);
useEffect(() => {
if (!blob) { setValue(null); return; }
const url = URL.createObjectURL(blob);
setValue({ blob, url });
return () => URL.revokeObjectURL(url);
}, [blob]);
return value?.blob === blob ? value.url : null;
}