fix: removing too soon from ls, bad page on mark as unread
This commit is contained in:
@@ -22,7 +22,6 @@ export function MarkAsUnreadButton({ bookId, onSuccess, className }: MarkAsUnrea
|
||||
e.stopPropagation(); // Empêcher la propagation au parent
|
||||
setIsLoading(true);
|
||||
try {
|
||||
ClientOfflineBookService.removeCurrentPageById(bookId);
|
||||
const response = await fetch(`/api/komga/books/${bookId}/read-progress`, {
|
||||
method: "DELETE",
|
||||
});
|
||||
@@ -31,6 +30,9 @@ export function MarkAsUnreadButton({ bookId, onSuccess, className }: MarkAsUnrea
|
||||
throw new Error(t("books.actions.markAsUnread.error.update"));
|
||||
}
|
||||
|
||||
// On supprime la page courante du localStorage seulement après que l'API a répondu
|
||||
ClientOfflineBookService.removeCurrentPageById(bookId);
|
||||
|
||||
toast({
|
||||
title: t("books.actions.markAsUnread.success.title"),
|
||||
description: t("books.actions.markAsUnread.success.description"),
|
||||
|
||||
Reference in New Issue
Block a user