File tree Expand file tree Collapse file tree 1 file changed +1
-18
lines changed
Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Original file line number Diff line number Diff line change @@ -316,24 +316,7 @@ export async function copyModuleInProject(
316316 moduleContent . changeIds ( ) ;
317317 moduleContentText = moduleContent . getModuleContentText ( ) ;
318318
319- await storage . saveFile ( newModulePath , moduleContentText ) ;
320-
321- // Update the project's mechanisms or opModes.
322- const newModule = {
323- modulePath : newModulePath ,
324- moduleType : oldModule . moduleType ,
325- projectName : project . projectName ,
326- className : newClassName
327- } ;
328- switch ( oldModule . moduleType ) {
329- case storageModule . ModuleType . MECHANISM :
330- project . mechanisms . push ( newModule as storageModule . Mechanism ) ;
331- break ;
332- case storageModule . ModuleType . OPMODE :
333- project . opModes . push ( newModule as storageModule . OpMode ) ;
334- break ;
335- }
336- await saveProjectInfo ( storage , project . projectName ) ;
319+ await addModuleToProject ( storage , project , oldModule . moduleType , newClassName ) ;
337320
338321 return newModulePath ;
339322}
You can’t perform that action at this time.
0 commit comments