Skip to content

Commit b701a0a

Browse files
author
Alberto Iannaccone
committed
improve condition to recognise cloud sketch
1 parent c8ac751 commit b701a0a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

arduino-ide-extension/src/browser/widgets/cloud-sketchbook/cloud-sketchbook-widget.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ import { Message } from '@theia/core/shared/@phosphor/messaging';
66
import { SketchesServiceClientImpl } from '../../../common/protocol/sketches-service-client-impl';
77
import { SketchControl } from '../../contributions/sketch-control';
88
import { LocalCacheFsProvider } from '../../local-cache/local-cache-fs-provider';
9-
import { REMOTE_SKETCHBOOK_FOLDER } from '../../utils/constants';
10-
9+
import {
10+
ARDUINO_CLOUD_FOLDER,
11+
REMOTE_SKETCHBOOK_FOLDER,
12+
} from '../../utils/constants';
13+
import * as path from 'path';
1114
@injectable()
1215
export class CloudSketchbookWidget extends SketchbookWidget {
1316
@inject(CloudSketchbookCompositeWidget)
@@ -47,7 +50,10 @@ export class CloudSketchbookWidget extends SketchbookWidget {
4750
async checkCloudEnabled(): Promise<void> {
4851
const currentSketch = await this.sketchesServiceClient.currentSketch();
4952
const isCloudSketch =
50-
currentSketch && currentSketch.uri.includes(REMOTE_SKETCHBOOK_FOLDER);
53+
currentSketch &&
54+
currentSketch.uri.includes(
55+
path.join(REMOTE_SKETCHBOOK_FOLDER, ARDUINO_CLOUD_FOLDER)
56+
);
5157

5258
if (this.arduinoPreferences['arduino.cloud.enabled']) {
5359
this.sketchbookTreesContainer.mode = 'multiple-document';

0 commit comments

Comments
 (0)