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
This commit is contained in:
schroda
2024-06-03 00:54:47 +02:00
parent fdf78145f0
commit 19e326c8ad

View File

@@ -314,14 +314,18 @@ export function Reader() {
: [chapter.id]; : [chapter.id];
requestManager requestManager
.updateChapters(chapterIds, { .updateChapters(
chapterIds,
{
...patch, ...patch,
chapterIdsToDelete: getChapterIdsToDelete(), chapterIdsToDelete: getChapterIdsToDelete(),
trackProgressMangaId: trackProgressMangaId:
metadataSettings.updateProgressAfterReading && patch.isRead && manga.trackRecords.totalCount metadataSettings.updateProgressAfterReading && patch.isRead && manga.trackRecords.totalCount
? manga.id ? manga.id
: undefined, : undefined,
}) },
{ errorPolicy: 'all' },
)
.response.catch(defaultPromiseErrorHandler('Reader::updateChapter')); .response.catch(defaultPromiseErrorHandler('Reader::updateChapter'));
}; };