diff --git a/desktop/app/src/PluginContainer.tsx b/desktop/app/src/PluginContainer.tsx index 7f0a42025..af71bfa1b 100644 --- a/desktop/app/src/PluginContainer.tsx +++ b/desktop/app/src/PluginContainer.tsx @@ -37,6 +37,7 @@ import { import React, {PureComponent} from 'react'; import {connect, ReactReduxContext} from 'react-redux'; import {setPluginState} from './reducers/pluginStates'; +import {Settings} from './reducers/settings'; import {selectPlugin} from './reducers/connections'; import {State as Store, MiddlewareAPI} from './reducers/index'; import {activateMenuItems} from './MenuBar'; @@ -44,7 +45,6 @@ import {Message} from './reducers/pluginMessageQueue'; import {Idler} from './utils/Idler'; import {processMessageQueue} from './utils/messageQueue'; import {ToggleButton, SmallText} from './ui'; -import debounceRender from 'react-debounce-render'; const Container = styled(FlexColumn)({ width: 0, @@ -103,6 +103,7 @@ type StateFromProps = { isArchivedDevice: boolean; pendingMessages: Message[] | undefined; pluginIsEnabled: boolean; + settingsState: Settings; }; type DispatchFromProps = { @@ -321,6 +322,7 @@ class PluginContainer extends PureComponent { target, isArchivedDevice, selectedApp, + settingsState, } = this.props; if (!activePlugin || !target || !pluginKey) { console.warn(`No selected plugin. Rendering empty!`); @@ -339,6 +341,7 @@ class PluginContainer extends PureComponent { key: pluginKey, logger: this.props.logger, selectedApp, + settingsState, persistedState: activePlugin.defaultPersistedState ? { ...activePlugin.defaultPersistedState, @@ -397,6 +400,7 @@ export default connect( pluginStates, plugins: {devicePlugins, clientPlugins}, pluginMessageQueue, + settingsState, }) => { let pluginKey = null; let target = null; @@ -447,6 +451,7 @@ export default connect( selectedApp: selectedApp || null, pendingMessages, pluginIsEnabled, + settingsState, }; return s; }, diff --git a/desktop/app/src/index.tsx b/desktop/app/src/index.tsx index efa9caad0..1bdbdb9a2 100644 --- a/desktop/app/src/index.tsx +++ b/desktop/app/src/index.tsx @@ -192,6 +192,6 @@ export {Logger} from './fb-interfaces/Logger'; export {getInstance as getLogger} from './fb-stubs/Logger'; export {callVSCode, getVSCodeUrl} from './utils/vscodeUtils'; export {useLocalStorage} from './utils/useLocalStorage'; - +export {checkIdbIsInstalled} from './utils/iOSContainerUtility'; // Sidebar extensions should be last so they can import anything from here. export {default as SidebarExtensions} from './fb-stubs/LayoutInspectorSidebarExtensions'; diff --git a/desktop/app/src/plugin.tsx b/desktop/app/src/plugin.tsx index d237bfc5c..324288b75 100644 --- a/desktop/app/src/plugin.tsx +++ b/desktop/app/src/plugin.tsx @@ -21,6 +21,7 @@ import {StaticView} from './reducers/connections'; import {State as ReduxState} from './reducers'; import {DEFAULT_MAX_QUEUE_SIZE} from './reducers/pluginMessageQueue'; import {PluginDetails} from 'flipper-plugin-lib'; +import {Settings} from './reducers/settings'; type Parameters = {[key: string]: any}; // This function is intended to be called from outside of the plugin. @@ -74,6 +75,7 @@ export type Props = { isArchivedDevice: boolean; selectedApp: string | null; setStaticView: (payload: StaticView) => void; + settingsState: Settings; }; export type BaseAction = { diff --git a/desktop/app/src/utils/iOSContainerUtility.tsx b/desktop/app/src/utils/iOSContainerUtility.tsx index 51f289e81..dde1df711 100644 --- a/desktop/app/src/utils/iOSContainerUtility.tsx +++ b/desktop/app/src/utils/iOSContainerUtility.tsx @@ -107,7 +107,7 @@ async function pull( ); } -async function checkIdbIsInstalled(idbPath: string): Promise { +export async function checkIdbIsInstalled(idbPath: string): Promise { const isInstalled = await isAvailable(idbPath); if (!isInstalled) { throw new Error(