mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
Improve history with grouped chapters.
This commit is contained in:
@@ -167,6 +167,7 @@ class _ComicPageState extends LoadingState<ComicPage, ComicDetails>
|
||||
chapters: localComic.chapters,
|
||||
initialPage: history?.page,
|
||||
initialChapter: history?.ep,
|
||||
initialChapterGroup: history?.group,
|
||||
history: history ??
|
||||
History.fromModel(
|
||||
model: localComic,
|
||||
@@ -383,11 +384,19 @@ class _ComicPageState extends LoadingState<ComicPage, ComicDetails>
|
||||
bool haveChapter = comic.chapters != null;
|
||||
var page = history!.page;
|
||||
var ep = history!.ep;
|
||||
var group = history!.group;
|
||||
String text;
|
||||
if (haveChapter) {
|
||||
var epName = group == null
|
||||
? comic.chapters!.titles.elementAt(
|
||||
math.min(ep - 1, comic.chapters!.length - 1),
|
||||
)
|
||||
: comic.chapters!
|
||||
.getGroupByIndex(group - 1)
|
||||
.values
|
||||
.elementAt(ep - 1);
|
||||
text = "Last Reading: @epName Page @page".tlParams({
|
||||
'epName': comic.chapters!.titles.elementAt(
|
||||
math.min(ep - 1, comic.chapters!.length - 1)),
|
||||
'epName': epName,
|
||||
'page': page,
|
||||
});
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user