Files
navidrome/ui/src/actions/serverEvents.js
T
Deluan 4f83987840 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>
2025-06-29 11:35:10 -04:00

30 lines
701 B
JavaScript

export const EVENT_SCAN_STATUS = 'scanStatus'
export const EVENT_SERVER_START = 'serverStart'
export const EVENT_REFRESH_RESOURCE = 'refreshResource'
export const EVENT_NOW_PLAYING_COUNT = 'nowPlayingCount'
export const EVENT_STREAM_RECONNECTED = 'streamReconnected'
export const processEvent = (type, data) => ({
type,
data: data,
})
export const scanStatusUpdate = (data) => ({
type: EVENT_SCAN_STATUS,
data: data,
})
export const nowPlayingCountUpdate = (data) => ({
type: EVENT_NOW_PLAYING_COUNT,
data: data,
})
export const serverDown = () => ({
type: EVENT_SERVER_START,
data: {},
})
export const streamReconnected = () => ({
type: EVENT_STREAM_RECONNECTED,
data: {},
})