@@ -55,7 +55,7 @@ const Explorer = ({
5555 const [ deleteEntry , setDeleteEntry ] = useState < Entry | undefined > ( undefined ) ;
5656 const [ renameEntry , setRenameEntry ] = useState < Entry | undefined > ( undefined ) ;
5757 const [ selectedEntry , setSelectedEntry ] = useState < Entry | undefined > (
58- undefined ,
58+ undefined
5959 ) ;
6060 const [ selectedLocation , setSelectedLocation ] = useState ( "" ) ;
6161
@@ -156,10 +156,10 @@ const Explorer = ({
156156
157157 ///////////////// DELETE FILES AND FOLDERS ///////////////////////////////////
158158
159- const handleDeleteModal = ( file : Entry , is_dir : boolean ) => {
159+ const handleDeleteModal = ( file : Entry ) => {
160160 if ( file ) {
161161 setDeleteEntry ( file ) ;
162- setDeleteType ( is_dir ) ;
162+ setDeleteType ( file . is_dir ) ;
163163 setDeleteModalOpen ( true ) ;
164164 } else {
165165 warning ( "No file is currently selected." ) ;
@@ -175,7 +175,7 @@ const Explorer = ({
175175 const handleSubmitDeleteModal = async ( ) => {
176176 //currentFile === Absolute File path
177177 if ( deleteEntry ) {
178- console . log ( deleteEntry )
178+ console . log ( deleteEntry ) ;
179179 try {
180180 if ( deleteType ) {
181181 await api . folder . delete ( project , deleteEntry . path ) ;
@@ -207,7 +207,7 @@ const Explorer = ({
207207 //currentFile === Absolute File path
208208 if ( currentFile ) {
209209 if ( inFileList ( fileList , currentFile ) ) {
210- handleDeleteModal ( currentFile , false ) ;
210+ handleDeleteModal ( currentFile ) ;
211211 }
212212 } else {
213213 warning ( "No file is currently selected." ) ;
@@ -232,7 +232,7 @@ const Explorer = ({
232232
233233 const handleCreateFolderSubmit = async (
234234 location : string ,
235- folder_name : string ,
235+ folder_name : string
236236 ) => {
237237 if ( folder_name !== "" ) {
238238 try {
@@ -434,7 +434,10 @@ const Explorer = ({
434434 { api . modals ?. createFile ? (
435435 < api . modals . createFile . component
436436 isOpen = { isNewFileModalOpen }
437- onSubmit = { api . modals . createFile . onCreate }
437+ onSubmit = { ( project : string , location : string , ...args : any [ ] ) => {
438+ api . modals ! . createFile ! . onCreate ( project , location , ...args ) ;
439+ fetchFileList ( ) ;
440+ } }
438441 onClose = { handleCloseNewFileModal }
439442 fileList = { fileList }
440443 location = { selectedLocation }
0 commit comments