mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 01:15:28 +00:00
fix: correctly pass-through preview URLs
This commit is contained in:
@@ -120,7 +120,9 @@ export function FileUploader(props: Props) {
|
||||
|
||||
const [uploading, setUploading] = useState(false);
|
||||
const [previewFile, setPreviewFile] = useState<File>(null!);
|
||||
const [generatedPreviewURL, setGeneratedPreviewURL] = useState("");
|
||||
const [generatedPreviewURL, setGeneratedPreviewURL] = useState<
|
||||
string | undefined
|
||||
>(undefined);
|
||||
useEffect(() => {
|
||||
if (previewFile) {
|
||||
const url: string = URL.createObjectURL(previewFile);
|
||||
@@ -291,8 +293,8 @@ export function FileUploader(props: Props) {
|
||||
backgroundImage:
|
||||
style === "icon"
|
||||
? `url('${
|
||||
generatedPreviewURL ??
|
||||
previewURL ??
|
||||
generatedPreviewURL ||
|
||||
previewURL ||
|
||||
defaultPreview
|
||||
}')`
|
||||
: previewURL
|
||||
|
||||
Reference in New Issue
Block a user