From c9ac3c7c2b2387fb589851db8bb08e170919e793 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 17 Jul 2018 11:22:01 +0200 Subject: [PATCH] Fix search in shared folders --- www/common/proxy-manager.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/www/common/proxy-manager.js b/www/common/proxy-manager.js index 92ee6097a..3485c2f1d 100644 --- a/www/common/proxy-manager.js +++ b/www/common/proxy-manager.js @@ -122,7 +122,7 @@ define([ var results = uo.findFile(id); if (fPath) { // This is a shared folder, we have to fix the paths in the results - results.map(function (p) { + results.forEach(function (p) { Array.prototype.unshift.apply(p, fPath); }); } @@ -833,10 +833,11 @@ define([ userObjects.forEach(function (uo) { var fPath = _getUserObjectPath(Env, uo); var results = uo.search(value); + if (!results.length) { return; } if (fPath) { // This is a shared folder, we have to fix the paths in the search results - results = results.map(function (r) { - r.paths.map(function (p) { + results.forEach(function (r) { + r.paths.forEach(function (p) { Array.prototype.unshift.apply(p, fPath); }); }); @@ -964,7 +965,7 @@ define([ isFolderEmpty: callWithEnv(isFolderEmpty), isPathIn: callWithEnv(isPathIn), isSubpath: callWithEnv(isSubpath), - isinTrashRoot: callWithEnv(isInTrashRoot), + isInTrashRoot: callWithEnv(isInTrashRoot), comparePath: callWithEnv(comparePath), hasSubfolder: callWithEnv(hasSubfolder), hasFile: callWithEnv(hasFile),