From ad753deac7920e9fd9ef78d82c4d3bc2c88f69e2 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sun, 25 Jun 2023 16:27:34 -0400 Subject: [PATCH] Small fix --- playlet-web/src/lib/LinkDragDrop.svelte | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/playlet-web/src/lib/LinkDragDrop.svelte b/playlet-web/src/lib/LinkDragDrop.svelte index b307da06..02675af1 100644 --- a/playlet-web/src/lib/LinkDragDrop.svelte +++ b/playlet-web/src/lib/LinkDragDrop.svelte @@ -62,8 +62,10 @@ try { isLoading = true; videoMetadata = await invidiousApi.getVideoMetadata(videoId); - videoStartAtTimestamp = timestamp; - videoStartAtChecked = videoStartAtTimestamp !== undefined; + videoStartAtChecked = timestamp !== undefined; + if (videoStartAtChecked) { + videoStartAtTimestamp = timestamp; + } modal.showModal(); } finally { isLoading = false; @@ -93,12 +95,10 @@ function parseYouTubeUrl(url) { const urlSearchParams = new URLSearchParams(new URL(url).search); - function getTimestamp(){ + function getTimestamp() { const timestamp = urlSearchParams.get("t"); if (timestamp) { - return timestamp.endsWith("s") - ? timestamp.slice(0, -1) - : timestamp; + return timestamp.endsWith("s") ? timestamp.slice(0, -1) : timestamp; } } @@ -140,7 +140,7 @@ const timestamp = getTimestamp(); if (timestamp) { - result.timestamp = timestamp + result.timestamp = timestamp; } return result;