feat: apply coderabbit suggestions

This commit is contained in:
Kacper
2025-12-18 15:49:49 +01:00
parent c4a90d7f29
commit a85390b289
2 changed files with 13 additions and 4 deletions

View File

@@ -364,14 +364,20 @@ app.on("before-quit", () => {
// Native file dialogs // Native file dialogs
ipcMain.handle("dialog:openDirectory", async () => { ipcMain.handle("dialog:openDirectory", async () => {
const result = await dialog.showOpenDialog(mainWindow!, { if (!mainWindow) {
return { canceled: true, filePaths: [] };
}
const result = await dialog.showOpenDialog(mainWindow, {
properties: ["openDirectory", "createDirectory"], properties: ["openDirectory", "createDirectory"],
}); });
return result; return result;
}); });
ipcMain.handle("dialog:openFile", async (_, options = {}) => { ipcMain.handle("dialog:openFile", async (_, options = {}) => {
const result = await dialog.showOpenDialog(mainWindow!, { if (!mainWindow) {
return { canceled: true, filePaths: [] };
}
const result = await dialog.showOpenDialog(mainWindow, {
properties: ["openFile"], properties: ["openFile"],
...options, ...options,
}); });
@@ -379,7 +385,10 @@ ipcMain.handle("dialog:openFile", async (_, options = {}) => {
}); });
ipcMain.handle("dialog:saveFile", async (_, options = {}) => { ipcMain.handle("dialog:saveFile", async (_, options = {}) => {
const result = await dialog.showSaveDialog(mainWindow!, options); if (!mainWindow) {
return { canceled: true, filePath: undefined };
}
const result = await dialog.showSaveDialog(mainWindow, options);
return result; return result;
}); });

View File

@@ -61,7 +61,7 @@ export default defineConfig(({ command }) => {
}, },
}, },
server: { server: {
port: 3007, port: parseInt(process.env.TEST_PORT || "3007", 10),
}, },
build: { build: {
outDir: "dist", outDir: "dist",