mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-24 11:46:31 +00:00
Fix Error: Cannot find module ../global-shortcut
in Windows (#353)
Since the Electron upgrade, Windows users are hitting a weird error about `global-shortcut` not existing. A solution is to `require('global-shortcut')` instead of accessing it as a property of `electorn`. Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
parent
2fdad8adcb
commit
1ac0fae405
@ -17,6 +17,7 @@
|
||||
'use strict';
|
||||
|
||||
const electron = require('electron');
|
||||
const globalShortcut = require('global-shortcut');
|
||||
const path = require('path');
|
||||
const elevate = require('./elevate');
|
||||
const packageJSON = require('../package.json');
|
||||
@ -63,7 +64,7 @@ electron.app.on('ready', function() {
|
||||
mainWindow = null;
|
||||
});
|
||||
|
||||
electron.globalShortcut.register('CmdOrCtrl+Alt+I', function() {
|
||||
globalShortcut.register('CmdOrCtrl+Alt+I', function() {
|
||||
mainWindow.webContents.openDevTools();
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user