From 6224ad4596df4f31559b5a99119c5361ae4da741 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Wed, 26 Jun 2024 13:59:14 +0200 Subject: [PATCH] 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 --- src/lib/data/Mangas.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/data/Mangas.ts b/src/lib/data/Mangas.ts index d14806c7..9c992dfc 100644 --- a/src/lib/data/Mangas.ts +++ b/src/lib/data/Mangas.ts @@ -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, ]); }