fix(ui): keep the NowPlayingPanel badge in sync.

Introduced a new event, EVENT_STREAM_RECONNECTED, to track the last
timestamp of stream reconnections. This change updates the activity
reducer to handle the new event and modifies the NowPlayingPanel to
refresh data based on server and stream status.

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan
2025-06-29 11:35:10 -04:00
parent dce7705999
commit 4f83987840
6 changed files with 197 additions and 22 deletions
+3 -1
View File
@@ -1,6 +1,6 @@
import { baseUrl } from './utils'
import throttle from 'lodash.throttle'
import { processEvent, serverDown } from './actions'
import { processEvent, serverDown, streamReconnected } from './actions'
import { REST_URL } from './consts'
import config from './config'
@@ -47,6 +47,8 @@ const connect = async (dispatchFn) => {
const stream = await newEventStream()
eventStream = stream
setupHandlers(stream, dispatchFn)
// Dispatch reconnection event to refresh critical data
dispatchFn(streamReconnected())
return stream
} catch (e) {
// eslint-disable-next-line no-console