From 242b2acb68f2ca3ddf6cb69cb327b0506be70568 Mon Sep 17 00:00:00 2001 From: klemek Date: Sun, 15 Mar 2026 17:49:25 +0100 Subject: [PATCH] fix: ts type check --- CNAME | 1 + src/App.vue | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..03be529 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +tape.klemek.fr diff --git a/src/App.vue b/src/App.vue index 629f2cd..7daa8e4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,10 +17,10 @@ const startedDate = ref(null); const canPlay = computed(() => ready.value && !playing.value); const canStop = computed(() => ready.value && playing.value); -function onChangeFile(event: InputEvent): void { +function onChangeFile(event: Event): void { ready.value = false; file.value = URL.createObjectURL( - (event.target as HTMLInputElement).files[0], + (event.target as HTMLInputElement).files![0] as File, ); audio.value = new Audio(file.value); audio.value.addEventListener("loadeddata", onAudioLoadedData); @@ -76,7 +76,7 @@ function getRemaining(): string { if (ended.value) { return "00:00"; } - if (!ready.value || !playing.value) { + if (!ready.value || !playing.value || !startedDate.value || !audio.value) { return "00:05"; } const d1 = Math.floor( @@ -133,7 +133,7 @@ onMounted(() => { Stop -

+

{{ remaining }}