Skip to content

Commit

Permalink
chore: fix comment message
Browse files Browse the repository at this point in the history
  • Loading branch information
Amirreza-Ghasemkhani authored and paulr34 committed Nov 29, 2022
1 parent c334612 commit 285e66f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src-electron/ui/ui-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,22 @@ function openFileDialogAndReportResult(
p.defaultPath = options.defaultPath
dialog.showOpenDialog(browserWindow, p).then((result) => {
if (!result.canceled) {
let paths : string[] = [];
// check if application is running on Windows standalone mode, then replace the backward slashs with forward slash
// otherwise it will throw a JSON syntax error
if(process.platform == "win32"){
result.filePaths.forEach(path => {
paths.push(
path.replace(/\\/g, '/')
);
})
}else{
paths = result.filePaths
}

let output = {
context: options.context,
filePaths: result.filePaths,
filePaths: paths,
}
browserApi.reportFiles(browserWindow, output)
}
Expand Down

0 comments on commit 285e66f

Please sign in to comment.