Fix chapter cards showing outdated download info after queue clear
In case clearing the download queue caused the subscription to omit items, the received items did not get removed from the cache. This resulted in the DownloadStateIndicator to show outdated download info.
This commit is contained in:
@@ -3555,8 +3555,15 @@ export class RequestManager {
|
||||
const { cache } = this.graphQLClient.client;
|
||||
|
||||
if (downloadChanged?.omittedUpdates) {
|
||||
const cacheData = (cache as InMemoryCache).extract();
|
||||
|
||||
this.graphQLClient.client.refetchQueries({
|
||||
updateCache() {
|
||||
for (const [id, value] of Object.entries(cacheData)) {
|
||||
if ((value as any)?.__typename === 'DownloadType') {
|
||||
cache.evict({ id });
|
||||
}
|
||||
}
|
||||
cache.evict({ id: 'DownloadStatus:{}' });
|
||||
cache.evict({ fieldName: 'downloadStatus' });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user