From e077b0a77bebf079be9122c11b5d12b63f33327c Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 30 Jan 2020 17:09:03 +1100 Subject: [PATCH] reload app on ctrl-r or f5 from anywhere --- main.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.js b/main.js index a5f55504a..d7f62fea6 100644 --- a/main.js +++ b/main.js @@ -14,6 +14,7 @@ const packageJson = require('./package.json'); const GlobalErrors = require('./app/global_errors'); GlobalErrors.addHandler(); +const { globalShortcut } = electron; const getRealPath = pify(fs.realpath); const { @@ -285,6 +286,13 @@ function createWindow() { // Disable system main menu mainWindow.setMenu(null); + globalShortcut.register('f5', () => { + mainWindow.reload() + }) + globalShortcut.register('CommandOrControl+R', () => { + mainWindow.reload() + }) + function captureAndSaveWindowStats() { if (!mainWindow) { return;