Feature/gql improve queries mutations subscriptions (#470)
* [Codegen] Request less fields for category mutations * [Codegen] Request less fields for chapter mutations * [Codegen] Request less fields for downloader mutations * [Codegen] Request less fields for extension mutations * [Codegen] Request less fields for manga mutations * [Codegen] Request less fields for source mutations * [Codegen] Request less fields for updater subscription * [Codegen] Request less fields for downloader subscription * [Codegen] Combine chapter update mutations
This commit is contained in:
@@ -164,21 +164,19 @@ export const ChapterList: React.FC<IProps> = ({ manga, isRefreshing }) => {
|
||||
if (action === 'delete') {
|
||||
actionPromise = requestManager.deleteDownloadedChapters(chapterIds).response;
|
||||
} else {
|
||||
actionPromise = requestManager.updateChapters(chapterIds, change).response;
|
||||
}
|
||||
const shouldDeleteChapters =
|
||||
action === 'mark_as_read' && metadataServerSettings.deleteChaptersManuallyMarkedRead;
|
||||
const chapterIdsToDelete = shouldDeleteChapters
|
||||
? actionChapters
|
||||
.filter(
|
||||
({ chapter }) =>
|
||||
chapter.isDownloaded &&
|
||||
(!chapter.isBookmarked || metadataServerSettings.deleteChaptersWithBookmark),
|
||||
)
|
||||
.map(({ chapter }) => chapter.id)
|
||||
: [];
|
||||
|
||||
const shouldDeleteChapters =
|
||||
action === 'mark_as_read' && metadataServerSettings.deleteChaptersManuallyMarkedRead;
|
||||
if (shouldDeleteChapters) {
|
||||
const chapterIdsToDelete = actionChapters
|
||||
.filter(
|
||||
({ chapter }) =>
|
||||
chapter.isDownloaded &&
|
||||
(!chapter.isBookmarked || metadataServerSettings.deleteChaptersWithBookmark),
|
||||
)
|
||||
.map(({ chapter }) => chapter.id);
|
||||
|
||||
requestManager.deleteDownloadedChapters(chapterIdsToDelete).response.catch(() => {});
|
||||
actionPromise = requestManager.updateChapters(chapterIds, { ...change, chapterIdsToDelete }).response;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user