File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -6,21 +6,17 @@ const RETRY_TIMEOUT = 5000;
6
6
const wsUri = window . localStorage . getItem ( LOCALSTORAGE_WS_URI ) || 'ws://localhost:8080/ws' ;
7
7
8
8
const websocket = {
9
- conn : null ,
9
+ conn : null as null | WebSocket ,
10
10
connect ( ) {
11
11
const ws = new WebSocket ( wsUri ) ;
12
- ws . onopen = ( event ) => {
12
+ ws . onopen = ( ) => {
13
13
console . info ( '[ffmpeg-commander] - websocket connection detected.' ) ;
14
- console . log ( event ) ;
15
- const { target } = event ;
16
- const isReady = target && target . readyState === WebSocket . OPEN ;
17
- store . setWSAction ( isReady ) ;
14
+ store . setWSAction ( ws . readyState === WebSocket . OPEN ) ;
18
15
} ;
19
16
20
- ws . onclose = ( event ) => {
17
+ ws . onclose = ( ) => {
21
18
console . info ( '[ffmpeg-commander] - websocket connection closed.' ) ;
22
- const isReady = event . target . readyState === WebSocket . OPEN ;
23
- store . setWSAction ( isReady ) ;
19
+ store . setWSAction ( ws . readyState === WebSocket . OPEN ) ;
24
20
ws . close ( ) ;
25
21
26
22
setTimeout ( ( ) => {
You can’t perform that action at this time.
0 commit comments