Skip to content

Commit

Permalink
fix: make dialogs modal
Browse files Browse the repository at this point in the history
make os dialogs (open, save, etc) modal so they appear above main window and not as a separate window.

fixes graasp#152
  • Loading branch information
Steph Tyszka committed Aug 28, 2019
1 parent 14e2222 commit 6f1efee
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion public/app/listeners/showDeleteSpacePrompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const showDeleteSpacePrompt = mainWindow => () => {
cancelId: 0,
message: 'Are you sure you want to delete this space?',
};
dialog.showMessageBox(null, options, respond => {
dialog.showMessageBox(mainWindow, options, respond => {
mainWindow.webContents.send(RESPOND_DELETE_SPACE_PROMPT_CHANNEL, respond);
});
};
Expand Down
2 changes: 1 addition & 1 deletion public/app/listeners/showExportSpacePrompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const showExportSpacePrompt = mainWindow => (event, spaceTitle) => {
title: 'Save As',
defaultPath: `${spaceTitle}.zip`,
};
dialog.showSaveDialog(null, options, filePath => {
dialog.showSaveDialog(mainWindow, options, filePath => {
mainWindow.webContents.send(RESPOND_EXPORT_SPACE_PROMPT_CHANNEL, filePath);
});
};
Expand Down
2 changes: 1 addition & 1 deletion public/app/listeners/showLoadSpacePrompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { dialog } = require('electron');
const { RESPOND_LOAD_SPACE_PROMPT_CHANNEL } = require('../config/channels');

const showLoadSpacePrompt = mainWindow => (event, options) => {
dialog.showOpenDialog(null, options, filePaths => {
dialog.showOpenDialog(mainWindow, options, filePaths => {
mainWindow.webContents.send(RESPOND_LOAD_SPACE_PROMPT_CHANNEL, filePaths);
});
};
Expand Down
2 changes: 1 addition & 1 deletion public/app/listeners/showSyncSpacePrompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const showSyncSpacePrompt = mainWindow => () => {
message:
'Are you sure you want to sync this space? All user input will be deleted.',
};
dialog.showMessageBox(null, options, respond => {
dialog.showMessageBox(mainWindow, options, respond => {
mainWindow.webContents.send(RESPOND_SYNC_SPACE_PROMPT_CHANNEL, respond);
});
};
Expand Down

0 comments on commit 6f1efee

Please sign in to comment.