mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-10 18:14:00 +02:00
Fix correct detection of existing files
Signed-off-by: Marco Dickert <marco@misterunknown.de>
This commit is contained in:
@@ -951,8 +951,10 @@ function IFM(params) {
|
|||||||
var existing_files;
|
var existing_files;
|
||||||
if (files.length > 1)
|
if (files.length > 1)
|
||||||
existing_files = files.map(x => x.name).filter(item => self.fileCache.map(x => x.name).includes(item));
|
existing_files = files.map(x => x.name).filter(item => self.fileCache.map(x => x.name).includes(item));
|
||||||
|
else if (newfilename)
|
||||||
|
existing_files = self.fileCache.map(x => x.name).indexOf(newfilename) !== -1 ? [newfilename] : [];
|
||||||
else
|
else
|
||||||
existing_files = self.fileCache.map(x => x.name).indexOf(newfilename) ? [newfilename] : [];
|
existing_files = self.fileCache.map(x => x.name).indexOf(files[0].name) !== -1 ? [files[0].name] : [];
|
||||||
if (existing_files.length > 0 && self.config.confirmoverwrite)
|
if (existing_files.length > 0 && self.config.confirmoverwrite)
|
||||||
self.showUploadConfirmOverwrite(files, existing_files, newfilename);
|
self.showUploadConfirmOverwrite(files, existing_files, newfilename);
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user