From c8f4ecd9cbf41e722f8a071ace0cba486a28629d Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 2 Sep 2022 14:33:03 +0200 Subject: [PATCH] fix drag drop --- apps/remix-ide/src/app/files/fileManager.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/files/fileManager.ts b/apps/remix-ide/src/app/files/fileManager.ts index 32892f9136..9d45788cd0 100644 --- a/apps/remix-ide/src/app/files/fileManager.ts +++ b/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) } }