This repository was archived by the owner on Dec 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 3
3
4
4
import * as React from "react" ;
5
5
import "./App.css" ;
6
- import { DEVICE_LIST_KEY , VSCODE_MESSAGES_TO_WEBVIEW } from "./constants" ;
6
+ import {
7
+ DEVICE_LIST_KEY ,
8
+ VSCODE_MESSAGES_TO_WEBVIEW ,
9
+ DEBUG_COMMANDS ,
10
+ } from "./constants" ;
7
11
import { Device } from "./container/device/Device" ;
8
12
9
13
interface IState {
@@ -48,11 +52,15 @@ class App extends React.Component<{}, IState> {
48
52
handleMessage = ( event : any ) : void => {
49
53
const message = event . data ;
50
54
console . log ( JSON . stringify ( message ) ) ;
51
- if (
52
- message . command === VSCODE_MESSAGES_TO_WEBVIEW . SET_DEVICE &&
53
- message . active_device !== this . state . currentDevice
54
- ) {
55
- this . setState ( { currentDevice : message . active_device } ) ;
55
+ switch ( message . command ) {
56
+ case VSCODE_MESSAGES_TO_WEBVIEW . SET_DEVICE :
57
+ if ( message . active_device !== this . state . currentDevice ) {
58
+ this . setState ( { currentDevice : message . active_device } ) ;
59
+ }
60
+ break ;
61
+ case DEBUG_COMMANDS . CONTINUE :
62
+ case DEBUG_COMMANDS . STACK_TRACE :
63
+ break ;
56
64
}
57
65
} ;
58
66
}
Original file line number Diff line number Diff line change @@ -67,5 +67,9 @@ export enum WEBVIEW_MESSAGES {
67
67
export enum VSCODE_MESSAGES_TO_WEBVIEW {
68
68
SET_DEVICE = "set-device" ,
69
69
}
70
+ export enum DEBUG_COMMANDS {
71
+ STACK_TRACE = "stackTrace" ,
72
+ CONTINUE = "continue" ,
73
+ }
70
74
71
75
export default CONSTANTS ;
You can’t perform that action at this time.
0 commit comments