@@ -608,12 +608,12 @@ const fileAdded = (state: BrowserState, path: string): { [x: string]: Record<str
608608 let files = state . mode === 'browser' ? state . browser . files : state . localhost . files
609609 const _path = splitPath ( state , path )
610610
611- files = _ . set ( files , _path , {
611+ files = _ . setWith ( files , _path , {
612612 path : path ,
613613 name : extractNameFromKey ( path ) ,
614614 isDirectory : false ,
615615 type : 'file'
616- } )
616+ } , Object )
617617 return files
618618}
619619
@@ -638,13 +638,13 @@ const removeInputField = (state: BrowserState, path: string): { [x: string]: Rec
638638
639639 if ( prevFiles ) {
640640 prevFiles . child && prevFiles . child [ path + '/' + 'blank' ] && delete prevFiles . child [ path + '/' + 'blank' ]
641- files = _ . set ( files , _path , {
641+ files = _ . setWith ( files , _path , {
642642 isDirectory : true ,
643643 path,
644644 name : extractNameFromKey ( path ) . indexOf ( 'gist-' ) === 0 ? extractNameFromKey ( path ) . split ( '-' ) [ 1 ] : extractNameFromKey ( path ) ,
645645 type : extractNameFromKey ( path ) . indexOf ( 'gist-' ) === 0 ? 'gist' : 'folder' ,
646646 child : prevFiles ? prevFiles . child : { }
647- } )
647+ } , Object )
648648 }
649649
650650 return files
@@ -674,7 +674,7 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s
674674 delete prevFiles . child [ deletePath ]
675675 }
676676 }
677- files = _ . set ( files , _path , prevFiles )
677+ files = _ . setWith ( files , _path , prevFiles , Object )
678678 } else if ( payload . fileTree && payload . path ) {
679679 files = { [ payload . path ] : normalize ( payload . fileTree , payload . path , payload . type ) }
680680 }
@@ -703,7 +703,7 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s
703703 delete prevFiles . child [ deletePath ]
704704 }
705705 }
706- files = _ . set ( files , _path , prevFiles )
706+ files = _ . setWith ( files , _path , prevFiles , Object )
707707 } else {
708708 files = { [ payload . path ] : normalize ( payload . fileTree , payload . path , payload . type ) }
709709 }
0 commit comments