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

Commit 5d88fc5

Browse files
Merge pull request #337 from microsoft/users/t-xunguy/switch-fix
Fix the switch for CPX
2 parents 3753cc1 + b4312b7 commit 5d88fc5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/extension.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ export async function activate(context: vscode.ExtensionContext) {
279279
currentPanel,
280280
context
281281
);
282-
console.log("sent");
283282
}
284283

285284
currentPanel.onDidDispose(

src/view/components/cpx/CpxSimulator.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,12 @@ class Simulator extends React.Component<{}, IState> {
368368
}
369369

370370
private handleSwitchClick() {
371-
let cpxState = this.state.cpx;
372-
const switchIsOn: boolean = !this.state.cpx.switch;
371+
const switchIsOn = !this.state.cpx.switch;
373372
updateSwitch(switchIsOn);
374-
cpxState = { ...cpxState, switch: switchIsOn };
375-
this.setState({ ...this.state, ...cpxState });
373+
this.setState({
374+
...this.state,
375+
cpx: { ...this.state.cpx, switch: switchIsOn },
376+
});
376377
return { switch: switchIsOn };
377378
}
378379

0 commit comments

Comments
 (0)