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:
@@ -2970,6 +2970,17 @@ export class RequestManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (downloadChanged?.state) {
|
||||||
|
cache.modify({
|
||||||
|
id: 'DownloadStatus:{}',
|
||||||
|
fields: {
|
||||||
|
state() {
|
||||||
|
return downloadChanged.state;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
downloadChanged?.updates.forEach((update) => {
|
downloadChanged?.updates.forEach((update) => {
|
||||||
if (![DownloadUpdateType.Dequeued, DownloadUpdateType.Finished].includes(update.type)) {
|
if (![DownloadUpdateType.Dequeued, DownloadUpdateType.Finished].includes(update.type)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user