diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f05fbaa..039729ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - (**Browse**) Fix not being able to select some languages as an "allowed language" in some situations (e.g., browser native language "en-GB" prevented "English" from getting visually shown as enabled) - (**Manga/Library**) Fix mark as read/unread option not being disabled for manga without any chapters - (**Manga/Library**) Fix delete/download option not being disabled for manga without any chapters +- (**Library**) Fix showing outdated category item after removing non library manga from categories - (**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 showing outdated download info in for some chapter cards after clearing the download queue diff --git a/src/lib/requests/RequestManager.ts b/src/lib/requests/RequestManager.ts index ac5f336f..d48ce27b 100644 --- a/src/lib/requests/RequestManager.ts +++ b/src/lib/requests/RequestManager.ts @@ -2393,6 +2393,14 @@ export class RequestManager { onCompleted: () => { this.graphQLClient.client.refetchQueries({ updateCache(cache) { + const data = (cache as InMemoryCache).extract(); + + for (const [id, value] of Object.entries(data)) { + if ((value as any).__typename === 'CategoryType') { + cache.evict({ id }); + } + } + cache.evict({ fieldName: 'categories' }); cache.evict({ fieldName: 'mangas' }); }, @@ -2419,6 +2427,14 @@ export class RequestManager { response.response.then(() => { this.graphQLClient.client.refetchQueries({ updateCache(cache) { + const data = (cache as InMemoryCache).extract(); + + for (const [id, value] of Object.entries(data)) { + if ((value as any).__typename === 'CategoryType') { + cache.evict({ id }); + } + } + cache.evict({ fieldName: 'categories' }); cache.evict({ fieldName: 'mangas' }); },