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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user