Prevent empty chapter updates on migration

In case there were no chapters to migrate the read or bookmark status, a request with an empty list was sent to the server.
This caused an exception on the server which resulted in a request failure which at the end caused the migration to fail
This commit is contained in:
schroda
2024-06-26 13:59:14 +02:00
parent f9b1d2bae2
commit 6224ad4596

View File

@@ -378,8 +378,9 @@ export class Mangas {
});
await Promise.all([
requestManager.updateChapters(readChapters, { isRead: true }).response,
requestManager.updateChapters(bookmarkedChapters, { isBookmarked: true }).response,
readChapters.length && requestManager.updateChapters(readChapters, { isRead: true }).response,
bookmarkedChapters.length &&
requestManager.updateChapters(bookmarkedChapters, { isBookmarked: true }).response,
]);
}