Add React Native/Metro hotkeys (#822)
Summary: This PR fixes https://github.com/facebook/flipper/issues/798 by adding customizable hotkeys to reload and/or open developer menu in React Native apps.  #### TODO: - [x] Add correct icon for removing content of the hotkey input (currently using `undo`) - cc passy 😄 ## Changelog Add customizable hotkeys to reload and/or open developer menu in React Native apps. Pull Request resolved: https://github.com/facebook/flipper/pull/822 Test Plan: - Run React Native on version `0.62.0-rc.2` (you can use this app: https://github.com/lucasbento/RNWithFlipper); - Open the Preferences window (`⌘,`); - Customise the React Native hotkeys to whatever you want; - Test them out with Flipper's window active and inactive. > **Note**: this has been tested only in macOS. Reviewed By: jknoxville Differential Revision: D20061833 Pulled By: passy fbshipit-source-id: 601d29e07d7de2683d2c70c7c87f0d841aa3559e
This commit is contained in:
committed by
Facebook Github Bot
parent
2d9d0314b9
commit
d1fb8bed4a
@@ -10,7 +10,13 @@
|
||||
const [s, ns] = process.hrtime();
|
||||
let launchStartTime: number | undefined = s * 1e3 + ns / 1e6;
|
||||
|
||||
import {app, BrowserWindow, ipcMain, Notification} from 'electron';
|
||||
import {
|
||||
app,
|
||||
BrowserWindow,
|
||||
ipcMain,
|
||||
Notification,
|
||||
globalShortcut,
|
||||
} from 'electron';
|
||||
import path from 'path';
|
||||
import url from 'url';
|
||||
import fs from 'fs';
|
||||
@@ -199,6 +205,10 @@ app.on('ready', () => {
|
||||
});
|
||||
});
|
||||
|
||||
app.on('will-quit', () => {
|
||||
globalShortcut.unregisterAll();
|
||||
});
|
||||
|
||||
ipcMain.on('componentDidMount', _event => {
|
||||
if (deeplinkURL) {
|
||||
win.webContents.send('flipper-protocol-handler', deeplinkURL);
|
||||
|
||||
Reference in New Issue
Block a user