11import {
22 getDirectoryPath ,
33 getModulePath ,
4- getModulesAndDirectoriesInDirectory ,
4+ getModulesAndDirectoriesInDirectory
55} from '@codesandbox/common/lib/sandbox/modules' ;
66import getDefinition from '@codesandbox/common/lib/templates' ;
77import { Directory , Module , UploadFile } from '@codesandbox/common/lib/types' ;
@@ -15,7 +15,7 @@ import denormalize from 'codesandbox-import-utils/lib/utils/files/denormalize';
1515
1616import {
1717 resolveDirectoryWrapped ,
18- resolveModuleWrapped ,
18+ resolveModuleWrapped
1919} from '../../utils/resolve-module-wrapped' ;
2020import * as internalActions from './internalActions' ;
2121
@@ -33,13 +33,13 @@ export const applyRecover: Action<Array<{
3333 recoveredList . forEach ( ( { recoverData, module } ) => {
3434 actions . editor . codeChanged ( {
3535 moduleShortid : module . shortid ,
36- code : recoverData . code ,
36+ code : recoverData . code
3737 } ) ;
3838 effects . vscode . setModuleCode ( module ) ;
3939 } ) ;
4040
4141 effects . analytics . track ( 'Files Recovered' , {
42- fileCount : recoveredList . length ,
42+ fileCount : recoveredList . length
4343 } ) ;
4444} ;
4545
@@ -56,13 +56,13 @@ export const createRecoverDiffs: Action<Array<{
5656 const oldCode = module . code ;
5757 actions . editor . codeChanged ( {
5858 moduleShortid : module . shortid ,
59- code : recoverData . code ,
59+ code : recoverData . code
6060 } ) ;
6161 effects . vscode . openDiff ( sandbox . id , module , oldCode ) ;
6262 } ) ;
6363
6464 effects . analytics . track ( 'Files Recovered' , {
65- fileCount : recoveredList . length ,
65+ fileCount : recoveredList . length
6666 } ) ;
6767} ;
6868
@@ -156,7 +156,7 @@ export const directoryCreated: AsyncAction<{
156156 insertedAt : new Date ( ) . toString ( ) ,
157157 updatedAt : new Date ( ) . toString ( ) ,
158158 type : 'directory' as 'directory' ,
159- path : ( null as unknown ) as string ,
159+ path : ( null as unknown ) as string
160160 } ;
161161
162162 sandbox . directories . push ( optimisticDirectory as Directory ) ;
@@ -189,7 +189,7 @@ export const directoryCreated: AsyncAction<{
189189
190190 Object . assign ( directory , {
191191 id : newDirectory . id ,
192- shortid : newDirectory . shortid ,
192+ shortid : newDirectory . shortid
193193 } ) ;
194194
195195 effects . live . sendDirectoryCreated ( directory ) ;
@@ -203,7 +203,7 @@ export const directoryCreated: AsyncAction<{
203203 state . editor . modulesByPath = effects . vscode . sandboxFsSync . create ( sandbox ) ;
204204 actions . internal . handleError ( {
205205 message : 'Unable to save new directory' ,
206- error,
206+ error
207207 } ) ;
208208 }
209209 } ,
@@ -259,7 +259,7 @@ export const moduleMovedToDirectory: AsyncAction<{
259259 state . editor . modulesByPath = effects . vscode . sandboxFsSync . create ( sandbox ) ;
260260 actions . internal . handleError ( {
261261 message : 'Could not save new module location' ,
262- error,
262+ error
263263 } ) ;
264264 }
265265
@@ -315,7 +315,7 @@ export const directoryMovedToDirectory: AsyncAction<{
315315 state . editor . modulesByPath = effects . vscode . sandboxFsSync . create ( sandbox ) ;
316316 actions . internal . handleError ( {
317317 message : 'Could not save new directory location' ,
318- error,
318+ error
319319 } ) ;
320320 }
321321
@@ -349,7 +349,7 @@ export const directoryDeleted: AsyncAction<{
349349 ) [ 0 ] ;
350350 const {
351351 removedModules,
352- removedDirectories,
352+ removedDirectories
353353 } = getModulesAndDirectoriesInDirectory (
354354 removedDirectory ,
355355 sandbox . modules ,
@@ -393,7 +393,7 @@ export const directoryDeleted: AsyncAction<{
393393 state . editor . modulesByPath = effects . vscode . sandboxFsSync . create ( sandbox ) ;
394394 actions . internal . handleError ( {
395395 message : 'Could not delete directory' ,
396- error,
396+ error
397397 } ) ;
398398 }
399399
@@ -427,7 +427,7 @@ export const directoryRenamed: AsyncAction<{
427427 actions . files . internal . renameDirectoryInState ( {
428428 directory,
429429 sandbox,
430- title,
430+ title
431431 } ) ;
432432
433433 actions . editor . internal . updatePreviewCode ( ) ;
@@ -443,11 +443,11 @@ export const directoryRenamed: AsyncAction<{
443443 actions . files . internal . renameDirectoryInState ( {
444444 directory,
445445 sandbox,
446- title : oldTitle ,
446+ title : oldTitle
447447 } ) ;
448448 actions . internal . handleError ( {
449449 message : 'Could not rename directory' ,
450- error,
450+ error
451451 } ) ;
452452 }
453453 } ,
@@ -473,7 +473,7 @@ export const gotUploadedFiles: AsyncAction<string> = async (
473473 } catch ( error ) {
474474 actions . internal . handleError ( {
475475 message : 'Unable to get uploaded files information' ,
476- error,
476+ error
477477 } ) ;
478478 }
479479} ;
@@ -491,7 +491,7 @@ export const addedFileToSandbox: AsyncAction<Pick<
491491 title : name ,
492492 directoryShortid : null ,
493493 code : url ,
494- isBinary : true ,
494+ isBinary : true
495495 } ) ;
496496
497497 effects . executor . updateFiles ( state . editor . currentSandbox ) ;
@@ -520,7 +520,7 @@ export const deletedUploadedFile: AsyncAction<string> = async (
520520 state . uploadedFiles . splice ( index , 0 , ...removedFiles ) ;
521521 actions . internal . handleError ( {
522522 message : 'Unable to delete uploaded file' ,
523- error,
523+ error
524524 } ) ;
525525 }
526526} ;
@@ -544,28 +544,29 @@ export const filesUploaded: AsyncAction<{
544544 const { modules, directories } = await actions . files . internal . uploadFiles (
545545 {
546546 files,
547- directoryShortid,
547+ directoryShortid
548548 }
549549 ) ;
550550
551551 actions . files . massCreateModules ( {
552552 modules,
553553 directories,
554- directoryShortid,
554+ directoryShortid
555555 } ) ;
556556
557557 effects . executor . updateFiles ( sandbox ) ;
558+ actions . git . updateGitChanges ( ) ;
558559 } catch ( error ) {
559560 if ( error . message . indexOf ( '413' ) !== - 1 ) {
560561 actions . internal . handleError ( {
561562 message :
`The uploaded file is bigger than 7MB, contact [email protected] if you want to raise this limit` , 562563 error,
563- hideErrorMessage : true ,
564+ hideErrorMessage : true
564565 } ) ;
565566 } else {
566567 actions . internal . handleError ( {
567568 message : 'Unable to upload files' ,
568- error,
569+ error
569570 } ) ;
570571 }
571572 }
@@ -631,7 +632,7 @@ export const massCreateModules: AsyncAction<{
631632
632633 actions . internal . handleError ( {
633634 message : 'Unable to create new files' ,
634- error,
635+ error
635636 } ) ;
636637 }
637638 } ,
@@ -662,7 +663,7 @@ export const moduleCreated: AsyncAction<{
662663 sourceId : sandbox . sourceId ,
663664 isNotSynced : true ,
664665 ...( code ? { code } : { } ) ,
665- ...( typeof isBinary === 'boolean' ? { isBinary } : { } ) ,
666+ ...( typeof isBinary === 'boolean' ? { isBinary } : { } )
666667 } ) ;
667668
668669 // We have to push the module to the array before we can figure out its path,
@@ -733,7 +734,7 @@ export const moduleCreated: AsyncAction<{
733734
734735 actions . internal . handleError ( {
735736 message : 'Unable to save new file' ,
736- error,
737+ error
737738 } ) ;
738739 }
739740
@@ -806,7 +807,7 @@ export const createModulesByPath: AsyncAction<{
806807 modules,
807808 directories,
808809 directoryShortid : null ,
809- cbID,
810+ cbID
810811 } ) ;
811812
812813 effects . executor . updateFiles ( sandbox ) ;
@@ -880,7 +881,7 @@ export const syncSandbox: AsyncAction<any[]> = async (
880881 actions . internal . handleError ( {
881882 message :
882883 "We weren't able to retrieve the latest files of the sandbox, please refresh" ,
883- error,
884+ error
884885 } ) ;
885886 }
886887
0 commit comments