Skip to content

Commit

Permalink
Merge pull request #187 from Suwayomi/main
Browse files Browse the repository at this point in the history
fix trackProgress while reading
  • Loading branch information
Robonau authored May 19, 2024
2 parents e669995 + 7631b52 commit 5bee081
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -392,19 +392,21 @@
}
];
if (!updatedChaps.includes(selector)) {
client
.mutation(updateChapter, {
id,
lastPageRead: pageIndex,
isRead: pageIndex >= maxPages * 0.8 ? true : null
})
.toPromise()
.then(() => {
if ($manga.data?.manga?.id)
client.mutation(trackProgress, {
mangaId: $manga.data?.manga?.id
});
});
async () => {
await client
.mutation(updateChapter, {
id,
lastPageRead: pageIndex,
isRead: pageIndex >= maxPages * 0.8 ? true : null
})
.toPromise();
if (!$manga.data?.manga?.id || pageIndex !== maxPages - 1) return;
await client
.mutation(trackProgress, {
mangaId: $manga.data?.manga?.id
})
.toPromise();
};
updatedChaps.push(selector);
setTimeout(() => {
updatedChaps = updatedChaps.filter((e) => e !== selector);
Expand Down

0 comments on commit 5bee081

Please sign in to comment.