diff --git a/src/view/App.tsx b/src/view/App.tsx index b0d26112d..9c4e0802a 100644 --- a/src/view/App.tsx +++ b/src/view/App.tsx @@ -3,7 +3,11 @@ import * as React from "react"; import "./App.css"; -import { DEVICE_LIST_KEY, VSCODE_MESSAGES_TO_WEBVIEW } from "./constants"; +import { + DEVICE_LIST_KEY, + VSCODE_MESSAGES_TO_WEBVIEW, + DEBUG_COMMANDS, +} from "./constants"; import { Device } from "./container/device/Device"; interface IState { @@ -48,11 +52,15 @@ class App extends React.Component<{}, IState> { handleMessage = (event: any): void => { const message = event.data; console.log(JSON.stringify(message)); - if ( - message.command === VSCODE_MESSAGES_TO_WEBVIEW.SET_DEVICE && - message.active_device !== this.state.currentDevice - ) { - this.setState({ currentDevice: message.active_device }); + switch (message.command) { + case VSCODE_MESSAGES_TO_WEBVIEW.SET_DEVICE: + if (message.active_device !== this.state.currentDevice) { + this.setState({ currentDevice: message.active_device }); + } + break; + case DEBUG_COMMANDS.CONTINUE: + case DEBUG_COMMANDS.STACK_TRACE: + break; } }; } diff --git a/src/view/constants.ts b/src/view/constants.ts index c754441e7..3b2159aa1 100644 --- a/src/view/constants.ts +++ b/src/view/constants.ts @@ -67,5 +67,9 @@ export enum WEBVIEW_MESSAGES { export enum VSCODE_MESSAGES_TO_WEBVIEW { SET_DEVICE = "set-device", } +export enum DEBUG_COMMANDS { + STACK_TRACE = "stackTrace", + CONTINUE = "continue", +} export default CONSTANTS;