mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 21:23:07 +00:00
feat: apply coderabbit suggestions
This commit is contained in:
@@ -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;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user