Skip to content

Commit

Permalink
fixed archive history in sidelist
Browse files Browse the repository at this point in the history
  • Loading branch information
mienaiyami committed Jul 16, 2023
1 parent bc4247c commit a26e997
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@

- PDFs not opening.
- Anilist data deleting after update in portable version.
- Repeated setting file save in epub.
- Reader Side-List not showing history for archive types.

---
7 changes: 6 additions & 1 deletion src/Components/ReaderSideList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ const ReaderSideList = memo(
const historyItem = history.find(
(e) => (e as MangaHistoryItem).data.mangaLink === window.path.dirname(mangaInReader.link)
);
if (historyItem) setHistorySimple((historyItem as MangaHistoryItem).data.chaptersRead);
if (historyItem)
setHistorySimple(
(historyItem as MangaHistoryItem).data.chaptersRead.map((e) =>
window.app.replaceExtension(e)
)
);
}
}, [history]);
useLayoutEffect(() => {
Expand Down
10 changes: 5 additions & 5 deletions src/MainImports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -826,11 +826,11 @@ const collator = Intl.Collator(undefined, { numeric: true, sensitivity: "base" }
window.app.betterSortOrder = collator.compare;
window.app.replaceExtension = (str, replaceWith = "~") => {
return str
.replace(/\.zip/gi, replaceWith === "~" ? " $ZIP" : replaceWith)
.replace(/\.cbz/gi, replaceWith === "~" ? " $CBZ" : replaceWith)
.replace(/\.epub/gi, replaceWith === "~" ? " $EPUB" : replaceWith)
.replace(/\.7z/gi, replaceWith === "~" ? " $7Z" : replaceWith)
.replace(/\.pdf/gi, replaceWith === "~" ? " $PDF" : replaceWith);
.replace(/\.zip$/i, replaceWith === "~" ? " $ZIP" : replaceWith)
.replace(/\.cbz$/i, replaceWith === "~" ? " $CBZ" : replaceWith)
.replace(/\.epub$/i, replaceWith === "~" ? " $EPUB" : replaceWith)
.replace(/\.7z$/i, replaceWith === "~" ? " $7Z" : replaceWith)
.replace(/\.pdf$/i, replaceWith === "~" ? " $PDF" : replaceWith);
};
window.app.isSupportedFormat = (str: string) =>
str.includes("$ZIP") ||
Expand Down

0 comments on commit a26e997

Please sign in to comment.