File tree 1 file changed +11
-3
lines changed
arduino-ide-extension/src/browser/widgets/cloud-sketchbook
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import URI from '@theia/core/lib/common/uri';
20
20
import { Create } from '../../create/typings' ;
21
21
import { nls } from '@theia/core/lib/common/nls' ;
22
22
import { Deferred } from '@theia/core/lib/common/promise-util' ;
23
+ import { ApplicationConnectionStatusContribution } from '../../theia/core/connection-status-service' ;
23
24
24
25
function sketchBaseDir ( sketch : Create . Sketch ) : FileStat {
25
26
// extract the sketch path
@@ -63,15 +64,22 @@ export class CloudSketchbookTreeModel extends SketchbookTreeModel {
63
64
private readonly authenticationService : AuthenticationClientService ;
64
65
@inject ( LocalCacheFsProvider )
65
66
private readonly localCacheFsProvider : LocalCacheFsProvider ;
67
+ @inject ( ApplicationConnectionStatusContribution )
68
+ private readonly connectionStatus : ApplicationConnectionStatusContribution ;
66
69
67
70
private _localCacheFsProviderReady : Deferred < void > | undefined ;
68
71
69
72
@postConstruct ( )
70
73
protected override init ( ) : void {
71
74
super . init ( ) ;
72
- this . toDispose . push (
73
- this . authenticationService . onSessionDidChange ( ( ) => this . updateRoot ( ) )
74
- ) ;
75
+ this . toDispose . pushAll ( [
76
+ this . authenticationService . onSessionDidChange ( ( ) => this . updateRoot ( ) ) ,
77
+ this . connectionStatus . onOfflineStatusDidChange ( ( offlineStatus ) => {
78
+ if ( ! offlineStatus ) {
79
+ this . updateRoot ( ) ;
80
+ }
81
+ } ) ,
82
+ ] ) ;
75
83
}
76
84
77
85
override * getNodesByUri ( uri : URI ) : IterableIterator < TreeNode > {
You can’t perform that action at this time.
0 commit comments