From aaca7eba9cac4cee1576ddef8e6b8ff04cbf2851 Mon Sep 17 00:00:00 2001 From: SimonShiki Date: Mon, 12 Aug 2024 10:43:24 +0800 Subject: [PATCH] :bug: fix: race condition in check song progress Signed-off-by: SimonShiki --- src/utils/player.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/player.ts b/src/utils/player.ts index fbf56d2..16bf017 100644 --- a/src/utils/player.ts +++ b/src/utils/player.ts @@ -185,7 +185,7 @@ function setupEventListeners () { const playing = sharedStore.get(playingJotai); if (playing) { const intervalId = setInterval(async () => { - if (!sharedStore.get(playingJotai)) { + if (!sharedStore.get(playingJotai) || !sharedStore.get(backendPlayingJotai)) { clearInterval(intervalId); } else { await updateProgress();