fix the issue of opening a local comic in history page

This commit is contained in:
2024-11-24 10:43:53 +08:00
parent 904e4f1186
commit 5bc3ddaf26

View File

@@ -97,7 +97,9 @@ class _HistoryPageState extends State<HistoryPage> {
e.subtitle,
null,
getDescription(e),
e.type.comicSource?.key ?? "Invalid:${e.type.value}",
e.type == ComicType.local
? 'local'
: e.type.comicSource?.key ?? "Unknown:${e.type.value}",
null,
null,
);
@@ -113,11 +115,16 @@ class _HistoryPageState extends State<HistoryPage> {
text: 'Remove'.tl,
color: context.colorScheme.error,
onClick: () {
if (c.sourceKey.startsWith("Invalid")) {
if (c.sourceKey.startsWith("Unknown")) {
HistoryManager().remove(
c.id,
ComicType(int.parse(c.sourceKey.split(':')[1])),
);
} else if (c.sourceKey == 'local') {
HistoryManager().remove(
c.id,
ComicType.local,
);
} else {
HistoryManager().remove(
c.id,