Skip to content

Commit

Permalink
Quick fox to silent crashing on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
junebug12851 committed Sep 9, 2018
1 parent 8dbfe65 commit 5a1659e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const { app, BrowserWindow } = require('electron');
const { app, globalShortcut, BrowserWindow } = require('electron');
const Store = require('electron-store')
const store = new Store()

Expand Down Expand Up @@ -44,6 +44,15 @@ function createWindow() {
icon
});

// Always allow opening dev tools in any build or platform
// In production the dev tools menu item will be removed but the dev tools
// themselves will always be openable with the same shortcut.
// This means your average user won't have to concern over it but developers
// or tinkerers can still access it if desired
globalShortcut.register('CommandOrControl+Shift+I', () => {
win.webContents.toggleDevTools();
});

if (isDev)
win.loadURL('http://localhost:4200');
else
Expand Down
2 changes: 1 addition & 1 deletion src/app/native/menus/prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ if (process.platform === 'darwin') {
});
}
else {
devMenu[0].submenu.splice(devMenu[0].submenu.length - 1, 0, {
prodMenu[0].submenu.splice(prodMenu[0].submenu.length - 1, 0, {
label: 'Exit',
click: () => {
window.keyboards.openPicKeyboard();
Expand Down

0 comments on commit 5a1659e

Please sign in to comment.