Remove instanceof checks
Summary: Replaced `instanceof` checks with `isSandyPlugin` utility. That is cleaner to read and makes it easier to find places where we make exceptions for Sandy plugins Reviewed By: jknoxville Differential Revision: D22206707 fbshipit-source-id: b44a1b585424f3b9bf0d7ce200c34107f03ed55e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1dc9e899b8
commit
04a29315e2
@@ -12,6 +12,7 @@ import {
|
||||
FlipperDevicePlugin,
|
||||
Props as PluginProps,
|
||||
PluginDefinition,
|
||||
isSandyPlugin,
|
||||
} from './plugin';
|
||||
import {Logger} from './fb-interfaces/Logger';
|
||||
import BaseDevice from './devices/BaseDevice';
|
||||
@@ -46,7 +47,6 @@ import {Message} from './reducers/pluginMessageQueue';
|
||||
import {Idler} from './utils/Idler';
|
||||
import {processMessageQueue} from './utils/messageQueue';
|
||||
import {ToggleButton, SmallText} from './ui';
|
||||
import {SandyPluginDefinition} from 'flipper-plugin';
|
||||
|
||||
const Container = styled(FlexColumn)({
|
||||
width: 0,
|
||||
@@ -193,7 +193,7 @@ class PluginContainer extends PureComponent<Props, State> {
|
||||
pluginIsEnabled &&
|
||||
activePlugin &&
|
||||
// TODO: support sandy: T68683442
|
||||
!(activePlugin instanceof SandyPluginDefinition) &&
|
||||
!isSandyPlugin(activePlugin) &&
|
||||
activePlugin.persistedStateReducer &&
|
||||
pluginKey &&
|
||||
pendingMessages?.length
|
||||
@@ -332,7 +332,7 @@ class PluginContainer extends PureComponent<Props, State> {
|
||||
console.warn(`No selected plugin. Rendering empty!`);
|
||||
return null;
|
||||
}
|
||||
if (activePlugin instanceof SandyPluginDefinition) {
|
||||
if (isSandyPlugin(activePlugin)) {
|
||||
// TODO:
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user