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:
schroda
2026-07-15 01:03:19 +02:00
parent 4023a8117e
commit e76de477a3
2 changed files with 8 additions and 0 deletions

View File

@@ -79,6 +79,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- (**Manga/Library**) Fix delete/download option not being disabled for manga without any chapters - (**Manga/Library**) Fix delete/download option not being disabled for manga without any chapters
- (**Source**) Fix changing configuration settings with multi option selection where a selected option does not exist anymore. (E.g. Komgas "Default libraries" setting, still having a library selected that has been deleted) - (**Source**) Fix changing configuration settings with multi option selection where a selected option does not exist anymore. (E.g. Komgas "Default libraries" setting, still having a library selected that has been deleted)
- (**Download**) Fix not respecting chapter list filters for downloads - (**Download**) Fix not respecting chapter list filters for downloads
- (**Download**) Fix showing outdated download info in for some chapter cards after clearing the download queue
## [20260509.01] (r3147) - 2026-05-09 ## [20260509.01] (r3147) - 2026-05-09

View File

@@ -3555,8 +3555,15 @@ export class RequestManager {
const { cache } = this.graphQLClient.client; const { cache } = this.graphQLClient.client;
if (downloadChanged?.omittedUpdates) { if (downloadChanged?.omittedUpdates) {
const cacheData = (cache as InMemoryCache).extract();
this.graphQLClient.client.refetchQueries({ this.graphQLClient.client.refetchQueries({
updateCache() { updateCache() {
for (const [id, value] of Object.entries(cacheData)) {
if ((value as any)?.__typename === 'DownloadType') {
cache.evict({ id });
}
}
cache.evict({ id: 'DownloadStatus:{}' }); cache.evict({ id: 'DownloadStatus:{}' });
cache.evict({ fieldName: 'downloadStatus' }); cache.evict({ fieldName: 'downloadStatus' });
}, },