Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Fix the switch for CPX #337

Merged
merged 2 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ export async function activate(context: vscode.ExtensionContext) {
currentPanel,
context
);
console.log("sent");
}

currentPanel.onDidDispose(
Expand Down
9 changes: 5 additions & 4 deletions src/view/components/cpx/CpxSimulator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}

Expand Down