fix drag drop

pull/5370/head
filip mertens 2 years ago committed by GitHub
parent eff3e0a7e7
commit 596cc592e6
  1. 5
      apps/remix-ide/src/app/files/fileManager.ts

@ -872,14 +872,15 @@ class FileManager extends Plugin {
await this._handleIsDir(src, `Cannot move ${src}. Path is not directory.`)
await this._handleIsDir(dest, `Cannot move content into ${dest}. Path is not directory.`)
const dirName = helper.extractNameFromKey(src)
if (await this.exists(dest + '/' + dirName)) {
if (await this.exists(dest + '/' + dirName) || src === dest) {
throw createError({ code: 'ENOENT', message: `Cannot move ${src}. Folder already exists at destination ${dest}`})
}
console.log('mv files')
await this.copyDir(src, dest, dirName)
await this.remove(src)
} catch (e) {
console.log('mv dir error', e)
throw new Error(e)
}
}

Loading…
Cancel
Save