feat(ui): update upload status with error message if import failed

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2308>
environments/review-front-2029-1110q1/deployments/16693
wvffle 2022-12-27 22:57:51 +00:00 zatwierdzone przez Georg Krause
rodzic ce522dbf59
commit 7f93311150
2 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1 @@
Update upload status when import fails (#1999)

Wyświetl plik

@ -128,6 +128,15 @@ useWebSocketHandler('import.status_updated', async (event) => {
// TODO (wvffle): Why?
await nextTick()
if (event.new_status === 'errored') {
for (const file of files.value) {
if (file.response?.uuid === event.upload.uuid) {
file.error = event.new_status
break
}
}
}
uploads[event.old_status] -= 1
uploads[event.new_status] += 1
uploads.objects[event.upload.uuid] = event.upload