Просмотр исходного кода

Fix NowPlayingBar closing during countdown between patterns

The bar was hiding during the pause between patterns because
current_playing_file is set to None for MQTT idle state reporting.
Added pause_time_remaining > 0 check to keep bar visible during countdown.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris 18 часов назад
Родитель
Сommit
44fe9049a2
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      frontend/src/components/layout/Layout.tsx

+ 2 - 1
frontend/src/components/layout/Layout.tsx

@@ -307,7 +307,8 @@ export function Layout() {
             const currentFile = data.data.current_file || null
             setCurrentPlayingFile(currentFile)
 
-            const isPlaying = Boolean(currentFile) || Boolean(data.data.is_running) || Boolean(data.data.is_paused)
+            // Include pause_time_remaining to keep bar visible during countdown between patterns
+            const isPlaying = Boolean(currentFile) || Boolean(data.data.is_running) || Boolean(data.data.is_paused) || (data.data.pause_time_remaining ?? 0) > 0
             // Skip auto-open on first message (page refresh) - only react to state changes
             if (wasPlayingRef.current !== null) {
               if (isPlaying && !wasPlayingRef.current) {