remove shortcuts

Reviewed By: aigoncharov

Differential Revision: D51159922

fbshipit-source-id: fbb59b416f92b9156c74a12247da8d0df07f1a4e
This commit is contained in:
Anton Kastritskiy
2023-11-10 04:33:02 -08:00
committed by Facebook GitHub Bot
parent 04b4bf7bdf
commit d023bcc42e
6 changed files with 0 additions and 133 deletions

View File

@@ -23,7 +23,6 @@ import {
ConfigText,
URLConfigField,
} from './settings/configFields';
import KeyboardShortcutInput from './settings/KeyboardShortcutInput';
import {isEqual, isMatch, isEmpty} from 'lodash';
import LauncherSettingsPanel from '../fb-stubs/LauncherSettingsPanel';
import {
@@ -124,7 +123,6 @@ class SettingsSheet extends Component<Props, State> {
enablePhysicalIOS,
enablePrefetching,
idbPath,
reactNative,
darkMode,
suppressPluginErrors,
persistDeviceData,
@@ -294,60 +292,6 @@ class SettingsSheet extends Component<Props, State> {
<Radio.Button value="system">Use System Setting</Radio.Button>
</Radio.Group>
</Layout.Container>
<ToggledSection
label="React Native keyboard shortcuts"
toggled={reactNative.shortcuts.enabled}
onChange={(enabled) => {
this.setState((prevState) => ({
updatedSettings: {
...prevState.updatedSettings,
reactNative: {
...prevState.updatedSettings.reactNative,
shortcuts: {
...prevState.updatedSettings.reactNative.shortcuts,
enabled,
},
},
},
}));
}}>
<KeyboardShortcutInput
label="Reload application"
value={reactNative.shortcuts.reload}
onChange={(reload) => {
this.setState((prevState) => ({
updatedSettings: {
...prevState.updatedSettings,
reactNative: {
...prevState.updatedSettings.reactNative,
shortcuts: {
...prevState.updatedSettings.reactNative.shortcuts,
reload,
},
},
},
}));
}}
/>
<KeyboardShortcutInput
label="Open developer menu"
value={reactNative.shortcuts.openDevMenu}
onChange={(openDevMenu) => {
this.setState((prevState) => ({
updatedSettings: {
...prevState.updatedSettings,
reactNative: {
...prevState.updatedSettings.reactNative,
shortcuts: {
...prevState.updatedSettings.reactNative.shortcuts,
openDevMenu,
},
},
},
}));
}}
/>
</ToggledSection>
<NUX
// TODO: provide link to Flipper doc with more details
title="Plugin marketplace serve as a way to distribute private/internal plugins"

View File

@@ -14,7 +14,6 @@ import notifications from './notifications';
import plugins from './plugins';
import user from './fb-stubs/user';
import pluginManager from './pluginManager';
import reactNative from './reactNative';
import pluginMarketplace from './pluginMarketplace';
import pluginDownloads from './pluginDownloads';
import info from '../utils/info';
@@ -39,7 +38,6 @@ export default async function (
plugins,
user,
pluginManager,
reactNative,
pluginMarketplace,
pluginDownloads,
info,

View File

@@ -1,58 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import {Store} from '../reducers';
import {registerShortcut} from '../utils/registerShortcut';
type ShortcutEventCommand =
| {
shortcut: string;
command: string;
}
| '';
export default (store: Store) => {
const settings = store.getState().settingsState.reactNative;
if (!settings?.shortcuts.enabled) {
return;
}
const shortcuts: ShortcutEventCommand[] = [
settings.shortcuts.reload && {
shortcut: settings.shortcuts.reload,
command: 'reload',
},
settings.shortcuts.openDevMenu && {
shortcut: settings.shortcuts.openDevMenu,
command: 'devMenu',
},
];
shortcuts.forEach(
(shortcut: ShortcutEventCommand) =>
shortcut &&
shortcut.shortcut &&
registerShortcut(shortcut.shortcut, () => {
const devices = store
.getState()
.connections.devices.filter(
(device) => device.os === 'Metro' && !device.isArchived,
);
devices.forEach((device) =>
device.flipperServer.exec(
'metro-command',
device.serial,
shortcut.command,
),
);
}),
);
};