Skip to content

Commit

Permalink
fixed: epub openInNewWindow error
Browse files Browse the repository at this point in the history
  • Loading branch information
mienaiyami committed Jul 31, 2023
1 parent 80cdac1 commit 9ce274d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,16 @@ const App = (): ReactElement => {
};

const openInNewWindow = (link: string) => {
checkValidFolder(
link,
(isValid) => {
if (isValid) window.electron.ipcRenderer.send("openLinkInNewWindow", link);
},
false
);
if (link.toLowerCase().includes(".epub") && window.fs.existsSync(link))
window.electron.ipcRenderer.send("openLinkInNewWindow", link);
else
checkValidFolder(
link,
(isValid) => {
if (isValid) window.electron.ipcRenderer.send("openLinkInNewWindow", link);
},
false
);
};

useLayoutEffect(() => {
Expand Down

0 comments on commit 9ce274d

Please sign in to comment.