fix: ts type check

This commit is contained in:
2026-03-15 17:49:25 +01:00
parent cea7460a3d
commit 242b2acb68
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -0,0 +1 @@
tape.klemek.fr
+4 -4
View File
@@ -17,10 +17,10 @@ const startedDate = ref<Date | null>(null);
const canPlay = computed<boolean>(() => ready.value && !playing.value); const canPlay = computed<boolean>(() => ready.value && !playing.value);
const canStop = computed<boolean>(() => ready.value && playing.value); const canStop = computed<boolean>(() => ready.value && playing.value);
function onChangeFile(event: InputEvent): void { function onChangeFile(event: Event): void {
ready.value = false; ready.value = false;
file.value = URL.createObjectURL( 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 = new Audio(file.value);
audio.value.addEventListener("loadeddata", onAudioLoadedData); audio.value.addEventListener("loadeddata", onAudioLoadedData);
@@ -76,7 +76,7 @@ function getRemaining(): string {
if (ended.value) { if (ended.value) {
return "00:00"; return "00:00";
} }
if (!ready.value || !playing.value) { if (!ready.value || !playing.value || !startedDate.value || !audio.value) {
return "00:05"; return "00:05";
} }
const d1 = Math.floor( const d1 = Math.floor(
@@ -133,7 +133,7 @@ onMounted(() => {
<LucideIcon name="square" /> Stop <LucideIcon name="square" /> Stop
</button> </button>
</div> </div>
<h1 :id="rid" :title="rid" :style="{ color: color }"> <h1 :id="rid" :title="rid" :style="{ color: color ?? '' }">
{{ remaining }} {{ remaining }}
</h1> </h1>
<hr /> <hr />