feat: introduced cloud state in sketchbook view

Closes #1879
Closes #1876
Closes #1899
Closes #1878

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta
2023-02-15 18:03:37 +01:00
committed by Akos Kitta
parent b09ae48536
commit 0ab28266df
53 changed files with 1971 additions and 659 deletions

View File

@@ -20,6 +20,7 @@ import URI from '@theia/core/lib/common/uri';
import { Create } from '../../create/typings';
import { nls } from '@theia/core/lib/common/nls';
import { Deferred } from '@theia/core/lib/common/promise-util';
import { ApplicationConnectionStatusContribution } from '../../theia/core/connection-status-service';
function sketchBaseDir(sketch: Create.Sketch): FileStat {
// extract the sketch path
@@ -63,15 +64,22 @@ export class CloudSketchbookTreeModel extends SketchbookTreeModel {
private readonly authenticationService: AuthenticationClientService;
@inject(LocalCacheFsProvider)
private readonly localCacheFsProvider: LocalCacheFsProvider;
@inject(ApplicationConnectionStatusContribution)
private readonly connectionStatus: ApplicationConnectionStatusContribution;
private _localCacheFsProviderReady: Deferred<void> | undefined;
@postConstruct()
protected override init(): void {
super.init();
this.toDispose.push(
this.authenticationService.onSessionDidChange(() => this.updateRoot())
);
this.toDispose.pushAll([
this.authenticationService.onSessionDidChange(() => this.updateRoot()),
this.connectionStatus.onOfflineStatusDidChange((offlineStatus) => {
if (!offlineStatus) {
this.updateRoot();
}
}),
]);
}
override *getNodesByUri(uri: URI): IterableIterator<TreeNode> {