From 19e326c8adaa81b90591e3e442b22d3c55545239 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Mon, 3 Jun 2024 00:54:47 +0200 Subject: [PATCH] Allow partial response for Reader chapter update It's possible that the "trackProgress" mutation of the "updateChapters" mutation fails, which then would lead to the "mark as read" and "delete chapter" mutation data to be omitted, thus, preventing the cache from being updated with the received mutation data response --- src/screens/Reader.tsx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/screens/Reader.tsx b/src/screens/Reader.tsx index 730647a9..96816246 100644 --- a/src/screens/Reader.tsx +++ b/src/screens/Reader.tsx @@ -314,14 +314,18 @@ export function Reader() { : [chapter.id]; requestManager - .updateChapters(chapterIds, { - ...patch, - chapterIdsToDelete: getChapterIdsToDelete(), - trackProgressMangaId: - metadataSettings.updateProgressAfterReading && patch.isRead && manga.trackRecords.totalCount - ? manga.id - : undefined, - }) + .updateChapters( + chapterIds, + { + ...patch, + chapterIdsToDelete: getChapterIdsToDelete(), + trackProgressMangaId: + metadataSettings.updateProgressAfterReading && patch.isRead && manga.trackRecords.totalCount + ? manga.id + : undefined, + }, + { errorPolicy: 'all' }, + ) .response.catch(defaultPromiseErrorHandler('Reader::updateChapter')); };