@@ -87,7 +87,7 @@ export class SketchControl extends SketchContribution {
87
87
currentSketch &&
88
88
parentsketch &&
89
89
parentsketch . uri === currentSketch . uri &&
90
- ( await this . allowRename ( parentsketch . uri ) )
90
+ this . allowRename ( parentsketch . uri )
91
91
) {
92
92
this . menuRegistry . registerMenuAction (
93
93
ArduinoMenus . SKETCH_CONTROL__CONTEXT__MAIN_GROUP ,
@@ -124,7 +124,7 @@ export class SketchControl extends SketchContribution {
124
124
currentSketch &&
125
125
parentsketch &&
126
126
parentsketch . uri === currentSketch . uri &&
127
- ( await this . allowDelete ( parentsketch . uri ) )
127
+ this . allowDelete ( parentsketch . uri )
128
128
) {
129
129
this . menuRegistry . registerMenuAction (
130
130
ArduinoMenus . SKETCH_CONTROL__CONTEXT__MAIN_GROUP ,
@@ -249,20 +249,24 @@ export class SketchControl extends SketchContribution {
249
249
} ) ;
250
250
}
251
251
252
- protected async isCloudSketch ( uri : string ) {
253
- const cloudCacheLocation = this . localCacheFsProvider . from ( new URI ( uri ) ) ;
252
+ protected isCloudSketch ( uri : string ) : boolean {
253
+ try {
254
+ const cloudCacheLocation = this . localCacheFsProvider . from ( new URI ( uri ) ) ;
254
255
255
- if ( cloudCacheLocation ) {
256
- return true ;
256
+ if ( cloudCacheLocation ) {
257
+ return true ;
258
+ }
259
+ return false ;
260
+ } catch {
261
+ return false ;
257
262
}
258
- return false ;
259
263
}
260
264
261
- protected async allowRename ( uri : string ) {
265
+ protected allowRename ( uri : string ) : boolean {
262
266
return ! this . isCloudSketch ( uri ) ;
263
267
}
264
268
265
- protected async allowDelete ( uri : string ) {
269
+ protected allowDelete ( uri : string ) : boolean {
266
270
return ! this . isCloudSketch ( uri ) ;
267
271
}
268
272
}
0 commit comments