Fixed issue where deleting a download caused favourites to be deleted.

This commit is contained in:
2024-12-18 17:58:18 +08:00
parent abaeaf4f77
commit 929ec88e84

View File

@@ -474,6 +474,7 @@ class LocalManager with ChangeNotifier {
dir.deleteIgnoreError(recursive: true); dir.deleteIgnoreError(recursive: true);
} }
// Deleting a local comic means that it's nolonger available, thus both favorite and history should be deleted. // Deleting a local comic means that it's nolonger available, thus both favorite and history should be deleted.
if(c.comicType == ComicType.local) {
if(HistoryManager().findSync(c.id, c.comicType) != null) { if(HistoryManager().findSync(c.id, c.comicType) != null) {
HistoryManager().remove(c.id, c.comicType); HistoryManager().remove(c.id, c.comicType);
} }
@@ -481,6 +482,7 @@ class LocalManager with ChangeNotifier {
for (var f in folders) { for (var f in folders) {
LocalFavoritesManager().deleteComicWithId(f, c.id, c.comicType); LocalFavoritesManager().deleteComicWithId(f, c.id, c.comicType);
} }
}
remove(c.id, c.comicType); remove(c.id, c.comicType);
notifyListeners(); notifyListeners();
} }