mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 10:32:27 +08:00
chore(review): use async
This commit is contained in:
parent
81755d804b
commit
bd363dac93
@ -1,4 +1,4 @@
|
|||||||
import fs from "fs";
|
import fs from "fs/promises";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import url from "url";
|
import url from "url";
|
||||||
import port from "./port.js";
|
import port from "./port.js";
|
||||||
@ -83,7 +83,7 @@ ipcMain.on("export-as-pdf", async (e, opts: ExportAsPdfOpts) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fs.writeFileSync(filePath, buffer);
|
await fs.writeFile(filePath, buffer);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
dialog.showErrorBox(t("pdf.unable-to-export-title"), t("pdf.unable-to-save-message"));
|
dialog.showErrorBox(t("pdf.unable-to-export-title"), t("pdf.unable-to-save-message"));
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user