remove console from layout inspector

Summary: We removed the console already from the client side. So this causes all calls to isConsoleEnabled to fail. This diffs removes these calls.

Reviewed By: passy

Differential Revision: D15449571

fbshipit-source-id: b702a8fbc80af002e1d8b7d37d5acc664ea5be99
This commit is contained in:
Daniel Büchele
2019-05-24 03:25:47 -07:00
committed by Facebook Github Bot
parent c1bff77f50
commit 1d6399c1b5

View File

@@ -11,9 +11,7 @@ import type Client from '../../Client.js';
import type {Logger} from '../../fb-interfaces/Logger.js'; import type {Logger} from '../../fb-interfaces/Logger.js';
import { import {
GK,
ManagedDataInspector, ManagedDataInspector,
Console,
Panel, Panel,
FlexCenter, FlexCenter,
styled, styled,
@@ -95,34 +93,7 @@ type Props = {|
logger: Logger, logger: Logger,
|}; |};
type State = {| export default class Sidebar extends Component<Props> {
isConsoleEnabled: boolean,
|};
export default class Sidebar extends Component<Props, State> {
state = {
isConsoleEnabled: false,
};
constructor(props: Props) {
super(props);
this.checkIfConsoleIsEnabled();
}
componentDidUpdate(prevProps: Props, prevState: State) {
if (prevProps.client !== this.props.client) {
this.checkIfConsoleIsEnabled();
}
}
checkIfConsoleIsEnabled() {
this.props.client
.call('isConsoleEnabled')
.then((result: {isEnabled: boolean}) => {
this.setState({isConsoleEnabled: result.isEnabled});
});
}
render() { render() {
const {element} = this.props; const {element} = this.props;
if (!element || !element.data) { if (!element || !element.data) {
@@ -181,13 +152,6 @@ export default class Sidebar extends Component<Props, State> {
} }
} }
if (GK.get('sonar_show_console_plugin') && this.state.isConsoleEnabled) {
sections.push(
<Panel heading="JS Console" floating={false} grow={false}>
<Console client={this.props.client} getContext={() => element.id} />
</Panel>,
);
}
return sections; return sections;
} }
} }