mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
Fixed an issue where clicking on local comics on the home page would cause the history to be lost. Close #196
This commit is contained in:
@@ -319,7 +319,7 @@ class HistoryManager with ChangeNotifier {
|
|||||||
for (var element in res) {
|
for (var element in res) {
|
||||||
_cachedHistoryIds![element["id"] as String] = true;
|
_cachedHistoryIds![element["id"] as String] = true;
|
||||||
}
|
}
|
||||||
for (var key in cachedHistories.keys) {
|
for (var key in cachedHistories.keys.toList()) {
|
||||||
if (!_cachedHistoryIds!.containsKey(key)) {
|
if (!_cachedHistoryIds!.containsKey(key)) {
|
||||||
cachedHistories.remove(key);
|
cachedHistories.remove(key);
|
||||||
}
|
}
|
||||||
|
@@ -165,6 +165,8 @@ class _ComicPageState extends LoadingState<ComicPage, ComicDetails>
|
|||||||
cid: widget.id,
|
cid: widget.id,
|
||||||
name: localComic.title,
|
name: localComic.title,
|
||||||
chapters: localComic.chapters,
|
chapters: localComic.chapters,
|
||||||
|
initialPage: history?.page,
|
||||||
|
initialChapter: history?.ep,
|
||||||
history: history ??
|
history: history ??
|
||||||
History.fromModel(
|
History.fromModel(
|
||||||
model: localComic,
|
model: localComic,
|
||||||
|
@@ -406,6 +406,9 @@ class _ContinuousModeState extends State<_ContinuousMode>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onPositionChanged() {
|
void onPositionChanged() {
|
||||||
|
if (itemPositionsListener.itemPositions.value.isEmpty) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var page = itemPositionsListener.itemPositions.value.first.index;
|
var page = itemPositionsListener.itemPositions.value.first.index;
|
||||||
page = page.clamp(1, reader.maxPage);
|
page = page.clamp(1, reader.maxPage);
|
||||||
if (page != reader.page) {
|
if (page != reader.page) {
|
||||||
|
Reference in New Issue
Block a user