fix drag drop

pull/2863/head
filip mertens 2 years ago committed by GitHub
parent c15c999e85
commit c8f4ecd9cb
  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