Skip to content

Commit

Permalink
Fix File dialog to match
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodearnest committed Oct 17, 2023
1 parent a85fa60 commit a8ea311
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions sacro-app/src/main-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,21 @@ const mainMenu = (serverUrl) => {
label: "File",
submenu: [
{
label: "Open File",
label: "Open Directory",
accelerator: "CommandOrControl+O",
click: async () => {
dialog
.showOpenDialog({
title: "Choose ACRO outputs json file",
properties: ["openFile"],
title: "Choose directory containing outputs you wish to review",
properties: ["openDirectory"],
defaultPath: os.homedir(),
filters: [
{ name: "ACRO Outputs", extensions: ["json", "acro"] },
{ name: "All files", extensions: ["*"] },
],
})
.then((result) => {
if (!result.canceled) {
const qs = querystring.stringify({
path: result.filePaths[0],
dirpath: result.filePaths[0],
});
const url = `${serverUrl}?${qs}`;
const url = `${serverUrl}/load?${qs}`;
BrowserWindow.getFocusedWindow().loadURL(url);
}
})
Expand Down

0 comments on commit a8ea311

Please sign in to comment.