Update download status state via subscription

The download query type (DownloadStatus) and download subscription type (DownloadUpdates) are different.
This means that the download state in the cache does not get automatically updated from the state provided in the subscription.
This commit is contained in:
schroda
2025-05-30 21:26:35 +02:00
parent 9443637b57
commit 29d0e3ae55

View File

@@ -2970,6 +2970,17 @@ export class RequestManager {
return;
}
if (downloadChanged?.state) {
cache.modify({
id: 'DownloadStatus:{}',
fields: {
state() {
return downloadChanged.state;
},
},
});
}
downloadChanged?.updates.forEach((update) => {
if (![DownloadUpdateType.Dequeued, DownloadUpdateType.Finished].includes(update.type)) {
return;