chore(suite-desktop): F5/cmd+R to reload app

This commit is contained in:
Tomáš Klíma
2022-07-25 12:05:34 +02:00
committed by Matěj Kříž
parent 6ff234ada8
commit 2cddfe2268
2 changed files with 8 additions and 8 deletions

View File

@@ -54,7 +54,9 @@ Available shortcuts:
| name | commands |
| --------------------- | ---------------------------------------------------- |
| Reload app (renderer) | F5, Ctrl+R, Cmd+R |
| Open DevTools | F12, Cmd+Shift+I,Ctrl+Shift+I, Cmd+Alt+I, Ctrl+Alt+I |
## Runtime flags
Runtime flags can be used when running the Suite Desktop executable, enabling or disabling certain features. For example: `./Trezor-Suite-22.7.2.AppImage --open-devtools` will run with this flag turned on, which will result in opening DevTools on app launch.

View File

@@ -18,14 +18,12 @@ const init: Module = ({ mainWindow }) => {
});
});
electronLocalshortcut.register(mainWindow, 'F5', () => {
logger.info('shortcuts', 'F5 pressed');
mainWindow.loadURL(APP_SRC);
});
electronLocalshortcut.register(mainWindow, 'CommandOrControl+R', () => {
logger.info('shortcuts', 'CTRL+R pressed');
mainWindow.loadURL(APP_SRC);
const reloadAppShortcuts = ['F5', 'CommandOrControl+R'];
reloadAppShortcuts.forEach(shortcut => {
electronLocalshortcut.register(mainWindow, shortcut, () => {
logger.info('shortcuts', `${shortcut} pressed to reload app`);
mainWindow.webContents.reload();
});
});
};