File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
apps/remix-ide/src/app/files Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -938,9 +938,16 @@ class FileManager extends Plugin {
938938 await this . _handleIsDir ( src , `Cannot move ${ src } . Path is not directory.` )
939939 await this . _handleIsDir ( dest , `Cannot move content into ${ dest } . Path is not directory.` )
940940 const dirName = helper . extractNameFromKey ( src )
941+ const provider = this . fileProviderOf ( src )
942+
941943 if ( await this . exists ( dest + '/' + dirName ) || src === dest ) {
942944 return false
943945 }
946+
947+ if ( provider . isSubDirectory ( src , dest ) ) {
948+ this . call ( 'notification' , 'toast' , recursivePasteToastMsg ( ) )
949+ return false
950+ }
944951 return true
945952 } catch ( e ) {
946953 console . log ( e )
@@ -998,7 +1005,13 @@ class FileManager extends Plugin {
9981005 if ( await this . exists ( dest + '/' + dirName ) || src === dest ) {
9991006 throw createError ( { code : 'EEXIST' , message : `Cannot move ${ src } . Folder already exists at destination ${ dest } ` } )
10001007 }
1001- await this . copyDir ( src , dest , dirName )
1008+ const provider = this . fileProviderOf ( src )
1009+
1010+ if ( provider . isSubDirectory ( src , dest ) ) {
1011+ this . call ( 'notification' , 'toast' , recursivePasteToastMsg ( ) )
1012+ return false
1013+ }
1014+ await this . inDepthCopy ( src , dest , dirName )
10021015 await this . remove ( src )
10031016
10041017 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments