Remove Console feature

Reviewed By: fabiomassimo

Differential Revision: D27622952

fbshipit-source-id: 45ce5188a55f50b8ca28f28f354d9402902a5df8
This commit is contained in:
Michel Weststrate
2021-04-09 05:01:57 -07:00
committed by Facebook GitHub Bot
parent ab255f0d13
commit 32bf4c32c2
5 changed files with 2 additions and 261 deletions

View File

@@ -14,8 +14,6 @@ import {Logger} from '../../../fb-interfaces/Logger';
import Panel from '../Panel';
import {DataInspector} from 'flipper-plugin';
import {Component} from 'react';
import {Console} from '../console';
import GK from '../../../fb-stubs/GK';
import React from 'react';
import deepEqual from 'deep-equal';
@@ -87,39 +85,13 @@ type Props = {
extensions?: Array<Function>;
};
type State = {
isConsoleEnabled: boolean;
};
type State = {};
export class InspectorSidebar extends Component<Props, State> {
state = {
isConsoleEnabled: false,
};
state = {};
constructor(props: Props) {
super(props);
this.checkIfConsoleIsEnabled();
}
componentDidUpdate(prevProps: Props) {
if (prevProps.client !== this.props.client) {
this.checkIfConsoleIsEnabled();
}
}
async checkIfConsoleIsEnabled() {
if (
this.props.client.isConnected &&
(await this.props.client.supportsMethod('isConsoleEnabled'))
) {
this.props.client
.call('isConsoleEnabled')
.then((result: {isEnabled: boolean}) => {
this.setState({isConsoleEnabled: result.isEnabled});
});
} else {
this.setState({isConsoleEnabled: false});
}
}
render() {
@@ -185,14 +157,6 @@ export class InspectorSidebar 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;
}
}