From 508ce4c962a29295d9b231d6cec3e0e82a836447 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 31 Jan 2025 22:19:19 +0200 Subject: [PATCH] feat(pdf): open the exported file --- src/services/window.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/window.ts b/src/services/window.ts index acff5b4e8..69fde7c88 100644 --- a/src/services/window.ts +++ b/src/services/window.ts @@ -8,7 +8,7 @@ import sqlInit from "./sql_init.js"; import cls from "./cls.js"; import keyboardActionsService from "./keyboard_actions.js"; import remoteMain from "@electron/remote/main/index.js"; -import { BrowserWindow, type App, type BrowserWindowConstructorOptions, type WebContents } from "electron"; +import { BrowserWindow, shell, type App, type BrowserWindowConstructorOptions, type WebContents } from "electron"; import { dialog, ipcMain } from "electron"; import { formatDownloadTitle, isDev, isMac, isWindows } from "./utils.js"; @@ -75,6 +75,8 @@ ipcMain.on("export-as-pdf", async (e, opts: ExportAsPdfOpts) => { // TODO: Report if there was an error in saving the PDF. fs.writeFileSync(filePath, buffer); + + shell.openPath(filePath); }); async function createMainWindow(app: App) {