web/remux: narrow file type
This commit is contained in:
parent
fff4393c46
commit
2c75c52eb3
3 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
||||||
export let classes = "";
|
export let classes = "";
|
||||||
|
|
||||||
export let draggedOver = false;
|
export let draggedOver = false;
|
||||||
export let file: File | Blob | undefined;
|
export let file: File | undefined;
|
||||||
|
|
||||||
const dropHandler = async (ev: DragEvent) => {
|
const dropHandler = async (ev: DragEvent) => {
|
||||||
draggedOver = false;
|
draggedOver = false;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
import IconFileImport from "@tabler/icons-svelte/IconFileImport.svelte";
|
import IconFileImport from "@tabler/icons-svelte/IconFileImport.svelte";
|
||||||
import IconUpload from "@tabler/icons-svelte/IconUpload.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 draggedOver = false;
|
||||||
export let acceptTypes: string[];
|
export let acceptTypes: string[];
|
||||||
export let acceptExtensions: string[];
|
export let acceptExtensions: string[];
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
import FileReceiver from "$components/misc/FileReceiver.svelte";
|
import FileReceiver from "$components/misc/FileReceiver.svelte";
|
||||||
|
|
||||||
let draggedOver = false;
|
let draggedOver = false;
|
||||||
let file: File | Blob | undefined;
|
let file: File | undefined;
|
||||||
|
|
||||||
let totalDuration: number | undefined;
|
let totalDuration: number | undefined;
|
||||||
let processedDuration: number | undefined;
|
let processedDuration: number | undefined;
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
totalDuration = Number(file_info.format.duration);
|
totalDuration = Number(file_info.format.duration);
|
||||||
|
|
||||||
if (file instanceof File && !file.type) {
|
if (file instanceof File && !file.type) {
|
||||||
file = new Blob([file], {
|
file = new File([ file ], file.name, {
|
||||||
type: mime.getType(file.name) ?? undefined,
|
type: mime.getType(file.name) ?? undefined,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue