Fix history

This commit is contained in:
2025-02-13 16:51:38 +08:00
parent fec1926774
commit 31e391ddae

View File

@@ -60,7 +60,8 @@ class _ComicPageState extends LoadingState<ComicPage, ComicDetails>
@override @override
void onReadEnd() { void onReadEnd() {
// The history is passed by reference, so it will be updated automatically. history ??= HistoryManager()
.findSync(widget.id, ComicType(widget.sourceKey.hashCode));
update(); update();
} }
@@ -678,7 +679,8 @@ abstract mixin class _ComicPageActions {
/// ///
/// [page] the page number, start from 1 /// [page] the page number, start from 1
void read([int? ep, int? page]) { void read([int? ep, int? page]) {
App.rootContext.to( App.rootContext
.to(
() => Reader( () => Reader(
type: comic.comicType, type: comic.comicType,
cid: comic.id, cid: comic.id,
@@ -690,7 +692,8 @@ abstract mixin class _ComicPageActions {
author: comic.findAuthor() ?? '', author: comic.findAuthor() ?? '',
tags: comic.plainTags, tags: comic.plainTags,
), ),
).then((_) { )
.then((_) {
onReadEnd(); onReadEnd();
}); });
} }