File tree 1 file changed +4
-2
lines changed
arduino-ide-extension/src/browser/theia/core
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
13
13
import { ArduinoDaemon } from '../../../common/protocol' ;
14
14
import { NotificationCenter } from '../../notification-center' ;
15
15
import { nls } from '@theia/core/lib/common' ;
16
+ import debounce = require( 'lodash.debounce' ) ;
16
17
17
18
@injectable ( )
18
19
export class FrontendConnectionStatusService extends TheiaFrontendConnectionStatusService {
@@ -36,10 +37,11 @@ export class FrontendConnectionStatusService extends TheiaFrontendConnectionStat
36
37
this . notificationCenter . onDaemonDidStop (
37
38
( ) => ( this . connectedPort = undefined )
38
39
) ;
39
- this . wsConnectionProvider . onIncomingMessageActivity ( ( ) => {
40
+ const refresh = debounce ( ( ) => {
40
41
this . updateStatus ( ! ! this . connectedPort ) ;
41
42
this . schedulePing ( ) ;
42
- } ) ;
43
+ } , this . options . offlineTimeout - 10 ) ;
44
+ this . wsConnectionProvider . onIncomingMessageActivity ( ( ) => refresh ( ) ) ;
43
45
}
44
46
}
45
47
You can’t perform that action at this time.
0 commit comments