mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-26 11:34:32 +00:00
Fixes updated time not updating the local state.
This commit is contained in:
parent
452e2ee213
commit
c225edc3ec
1 changed files with 11 additions and 2 deletions
|
|
@ -197,11 +197,20 @@ export const WebsocketProvider = ({ children }) => {
|
|||
const playlist = playlistsState.playlists.find(p => p.id === parsedEvent.data.account);
|
||||
|
||||
if (playlist) {
|
||||
playlistsState.updatePlaylist({
|
||||
// When we receive a "success" status with 100% progress, this is a completed refresh
|
||||
// So we should also update the updated_at timestamp
|
||||
const updateData = {
|
||||
...playlist,
|
||||
status: parsedEvent.data.status,
|
||||
last_message: parsedEvent.data.message || playlist.last_message
|
||||
});
|
||||
};
|
||||
|
||||
// Update the timestamp when we complete a successful refresh
|
||||
if (parsedEvent.data.status === 'success' && parsedEvent.data.progress === 100) {
|
||||
updateData.updated_at = new Date().toISOString();
|
||||
}
|
||||
|
||||
playlistsState.updatePlaylist(updateData);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue