File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed 
arduino-ide-extension/src Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 1+ export  const  REMOTE_SKETCHBOOK_FOLDER  =  'RemoteSketchbook' ; 
2+ export  const  ARDUINO_CLOUD_FOLDER  =  'ArduinoCloud' ; 
Original file line number Diff line number Diff line change @@ -11,12 +11,13 @@ import { FrontendApplicationContribution } from '@theia/core/lib/browser/fronten
1111import  {  Sketch ,  SketchesService  }  from  '../../common/protocol' ; 
1212import  {  ConfigService  }  from  './config-service' ; 
1313import  {  SketchContainer  }  from  './sketches-service' ; 
14+ import  { 
15+   ARDUINO_CLOUD_FOLDER , 
16+   REMOTE_SKETCHBOOK_FOLDER , 
17+ }  from  '../../browser/utils/constants' ; 
1418
15- const  READ_ONLY_FILES  =  [ 
16-   'thingProperties.h' , 
17-   'thingsProperties.h' , 
18-   'sketch.json' , 
19- ] ; 
19+ const  READ_ONLY_FILES  =  [ 'sketch.json' ] ; 
20+ const  READ_ONLY_FILES_REMOTE  =  [ 'thingProperties.h' ,  'thingsProperties.h' ] ; 
2021
2122@injectable ( ) 
2223export  class  SketchesServiceClientImpl 
@@ -178,7 +179,17 @@ export class SketchesServiceClientImpl
178179    if  ( toCheck . scheme  ===  'user-storage' )  { 
179180      return  false ; 
180181    } 
181-     if  ( READ_ONLY_FILES . includes ( toCheck ?. path ?. base ) )  { 
182+ 
183+     const  isCloudSketch  =  toCheck 
184+       . toString ( ) 
185+       . includes ( `${ REMOTE_SKETCHBOOK_FOLDER }  /${ ARDUINO_CLOUD_FOLDER }  ` ) ; 
186+ 
187+     const  filesToCheck  =  [ 
188+       ...READ_ONLY_FILES , 
189+       ...( isCloudSketch  ? READ_ONLY_FILES_REMOTE  : [ ] ) , 
190+     ] ; 
191+ 
192+     if  ( filesToCheck . includes ( toCheck ?. path ?. base ) )  { 
182193      return  true ; 
183194    } 
184195    const  readOnly  =  ! this . workspaceService 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments