mirror of
https://github.com/priyanshujain/margin.git
synced 2026-10-02 19:17:03 +00:00
changes
This commit is contained in:
1 parent
c86d5a7d5c
commit
0e0d334f6a
33 files changed
+401
-101
No files matched your search
+3
-3
@@ -5,7 +5,7 @@ import { EditorView } from "./components/EditorView";
|
||||
import { useBook } from "./store/useBook";
|
||||
import { isDesktop } from "./ipc";
|
||||
import { newBook } from "./library";
|
||||
import { exportEpub, exportPdf } from "./export/exporters";
|
||||
import { runExport } from "./export/run";
|
||||
|
||||
function App() {
|
||||
const book = useBook((s) => s.book);
|
||||
@@ -16,8 +16,8 @@ function App() {
|
||||
const unlisten = listen<string>("menu-action", (event) => {
|
||||
const state = useBook.getState();
|
||||
if (event.payload === "new-book") state.openBook(newBook());
|
||||
else if (event.payload === "export-pdf" && state.book) exportPdf(state.book);
|
||||
else if (event.payload === "export-epub" && state.book) exportEpub(state.book);
|
||||
else if (event.payload === "export-pdf") runExport("pdf");
|
||||
else if (event.payload === "export-epub") runExport("epub");
|
||||
});
|
||||
return () => {
|
||||
unlisten.then((stop) => stop());
|
||||
|
||||
Reference in new issue
Block a user