From 5a42df35a4e5490b388f5fedb5f2045ea8be76f6 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 18 Jan 2026 05:38:22 -0600 Subject: [PATCH] fix(ui): lock playlist import button after success cx --- src/lib/components/PlaylistImportModal.svelte | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/lib/components/PlaylistImportModal.svelte b/src/lib/components/PlaylistImportModal.svelte index f60c2d23d..10a846725 100644 --- a/src/lib/components/PlaylistImportModal.svelte +++ b/src/lib/components/PlaylistImportModal.svelte @@ -48,6 +48,8 @@ let lockedProvider = $state(null); let logEntries = $state<{ message: string; status: 'info' | 'success' | 'error' }[]>([]); let isOffline = $state(checkIsOffline()); + let importCompleted = $state(false); + let lastImportedUrl = $state(''); // Subscribe to offline state changes $effect(() => { @@ -76,6 +78,20 @@ summary = null; lockedProvider = null; logEntries = []; + importCompleted = false; + lastImportedUrl = ''; + } + }); + + $effect(() => { + if (!importCompleted) return; + const trimmed = url.trim(); + if (trimmed !== lastImportedUrl) { + error = null; + summary = null; + lockedProvider = null; + logEntries = []; + importCompleted = false; } }); @@ -127,6 +143,8 @@ }); summary = result; + importCompleted = true; + lastImportedUrl = url.trim(); pushLog(`Imported ${result.matched_tracks} of ${result.total_tracks} tracks into QBZ.`, 'success'); if (result.qobuz_playlist_id) { @@ -259,7 +277,7 @@