File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -30,16 +30,16 @@ const webXdc: WebXdc = {
30
30
socket . removeEventListener ( "open" , currentOpenEventListener ) ;
31
31
}
32
32
33
- // if the socket is connecting, we send the information
34
- // as soon as we're open
35
33
if ( socket . readyState === 0 ) {
34
+ // if the socket is connecting, we send the information
35
+ // as soon as we're open
36
36
const openEventListener = ( ) : void => {
37
37
socket . send ( JSON . stringify ( { type : "setUpdateListener" , serial } ) ) ;
38
38
} ;
39
39
currentOpenEventListener = openEventListener ;
40
40
socket . addEventListener ( "open" , openEventListener ) ;
41
41
} else if ( socket . readyState === 1 ) {
42
- // if it's open, we send the information immediately
42
+ // if it's already open, we send the information immediately
43
43
socket . send ( JSON . stringify ( { type : "setUpdateListener" , serial } ) ) ;
44
44
} else {
45
45
throw new Error ( "Cannot access socket to register setUpdateListener" ) ;
You can’t perform that action at this time.
0 commit comments