web/remux: narrow file type

This commit is contained in:
dumbmoron 2024-09-08 18:58:36 +00:00
parent fff4393c46
commit 2c75c52eb3
No known key found for this signature in database
3 changed files with 4 additions and 4 deletions

View file

@ -3,7 +3,7 @@
export let classes = "";
export let draggedOver = false;
export let file: File | Blob | undefined;
export let file: File | undefined;
const dropHandler = async (ev: DragEvent) => {
draggedOver = false;

View file

@ -5,7 +5,7 @@
import IconFileImport from "@tabler/icons-svelte/IconFileImport.svelte";
import IconUpload from "@tabler/icons-svelte/IconUpload.svelte";
export let file: File | Blob | undefined;
export let file: File | undefined;
export let draggedOver = false;
export let acceptTypes: string[];
export let acceptExtensions: string[];

View file

@ -13,7 +13,7 @@
import FileReceiver from "$components/misc/FileReceiver.svelte";
let draggedOver = false;
let file: File | Blob | undefined;
let file: File | undefined;
let totalDuration: number | undefined;
let processedDuration: number | undefined;
@ -104,7 +104,7 @@
totalDuration = Number(file_info.format.duration);
if (file instanceof File && !file.type) {
file = new Blob([file], {
file = new File([ file ], file.name, {
type: mime.getType(file.name) ?? undefined,
});
}