From a0cc43b9f0a5d5c1e7dd8b2455d7793b779e68a5 Mon Sep 17 00:00:00 2001 From: Anders Evenrud Date: Tue, 10 Dec 2019 16:26:48 +0100 Subject: [PATCH] Ignore equal drops (#7) --- index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index ab9edff..47b14c9 100644 --- a/index.js +++ b/index.js @@ -551,9 +551,11 @@ const createApplication = (core, proc, win, $content) => { .catch(error => dialog('error', {error, message: 'Failed to upload file(s)'})); } else if (data && data.path && data.filename) { const dest = {path: pathJoin(currentPath.path, data.filename)}; - vfs.copy(data, dest) - .then(() => refresh(true)) - .catch(error => dialog('error', {error, message: 'Failed to copy file'})); + if (dest.path !== data.path) { + vfs.copy(data, dest) + .then(() => refresh(true)) + .catch(error => dialog('error', {error, message: 'Failed to copy file'})); + } } });