diff options
author | Struan Donald <struan@exo.org.uk> | 2013-07-15 17:23:36 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-07-15 17:23:36 +0100 |
commit | c703a5466e7c45c8edcb9b7ed4cdf605e5fa4dcb (patch) | |
tree | 4b16b77314aab7a1580dd24ee6e6485c2d230f9c | |
parent | 8ca8662ced7cca6b4c30e38f06a5b85a1528551e (diff) |
do not try and move photos if the files are the same
-rw-r--r-- | src/js/files.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/js/files.js b/src/js/files.js index b8aed05..a3a6458 100644 --- a/src/js/files.js +++ b/src/js/files.js @@ -109,7 +109,15 @@ var move = $.Deferred(); - src.moveTo( dest, null, move.resolve, move.reject); + var destPath = dest.fullPath + '/' + src.name; + var srcPath = src.fullPath + ''; + if ( srcPath === destPath ) { + console.log('not moving because files are the same'); + move.resolve( src ); + } else { + console.log('paths differ so moving'); + src.moveTo( dest, null, move.resolve, move.reject); + } return move.promise(); } |