Commit 236d7b12 by Hugo Häggmark

Changes after PR comments

parent 67e8958a
......@@ -15,10 +15,10 @@ interface State {
}
export class TestRuleButton extends PureComponent<Props, State> {
constructor(props) {
super(props);
this.state = { isLoading: false, testRuleResponse: {} };
}
readonly state: State = {
isLoading: false,
testRuleResponse: {},
};
componentDidMount() {
this.testRule();
......@@ -39,10 +39,6 @@ export class TestRuleButton extends PureComponent<Props, State> {
return <LoadingPlaceholder text="Evaluating rule" />;
}
return (
<>
<JSONFormatter json={testRuleResponse} />
</>
);
return <JSONFormatter json={testRuleResponse} />;
}
}
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Render should render component 1`] = `
<Fragment>
<JSONFormatter
<JSONFormatter
config={
Object {
"animateOpen": true,
......@@ -10,6 +9,5 @@ exports[`Render should render component 1`] = `
}
json={Object {}}
open={3}
/>
</Fragment>
/>
`;
......@@ -52,7 +52,7 @@ export class EditorTabBody extends PureComponent<Props, State> {
onToggleToolBarView = (item: EditorToolbarView) => {
this.setState({
openView: item,
isOpen: this.state.openView !== item ? true : !this.state.isOpen,
isOpen: this.state.openView !== item || !this.state.isOpen,
});
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment