Skip to content

Commit

Permalink
fix: (hopefully) only allow CSV downloads on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrund14 committed Jan 14, 2021
1 parent b4b70ed commit e9e4d1f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ try {

// use server for route
mainWindow.loadURL(`http://localhost:${env.PORT}`)

mainWindow.webContents.session.on(
'will-download',
(event, downloadItem, webContents) => {
downloadItem.setSaveDialogOptions({
filters: [{ name: 'CSV', extensions: ['csv'] }],
message: 'Download CSV',
})
}
)
}

app.on('ready', createWindow)
Expand Down

0 comments on commit e9e4d1f

Please sign in to comment.