From 958230db71763a229a3f86404eaa25839298fcb9 Mon Sep 17 00:00:00 2001 From: xnkevinnguyen Date: Fri, 17 Apr 2020 10:45:40 -0700 Subject: [PATCH] Fix the switch --- src/extension.ts | 1 - src/view/components/cpx/CpxSimulator.tsx | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index b36de1f12..1fdf70da0 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -279,7 +279,6 @@ export async function activate(context: vscode.ExtensionContext) { currentPanel, context ); - console.log("sent"); } currentPanel.onDidDispose( diff --git a/src/view/components/cpx/CpxSimulator.tsx b/src/view/components/cpx/CpxSimulator.tsx index 24cf1728b..b0d77f441 100644 --- a/src/view/components/cpx/CpxSimulator.tsx +++ b/src/view/components/cpx/CpxSimulator.tsx @@ -368,11 +368,12 @@ class Simulator extends React.Component<{}, IState> { } private handleSwitchClick() { - let cpxState = this.state.cpx; - const switchIsOn: boolean = !this.state.cpx.switch; + const switchIsOn = !this.state.cpx.switch; updateSwitch(switchIsOn); - cpxState = { ...cpxState, switch: switchIsOn }; - this.setState({ ...this.state, ...cpxState }); + this.setState({ + ...this.state, + cpx: { ...this.state.cpx, switch: switchIsOn }, + }); return { switch: switchIsOn }; }