From: Rafal Walczyna Date: Tue, 29 Oct 2019 12:58:14 +0000 (+0100) Subject: [filesystem] Fix getAllStorages X-Git-Tag: submit/tizen_5.5/20191105.125113^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be9fc2d2b8a10674e7faa2dce0b52f42cb58cf1c;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [filesystem] Fix getAllStorages Fixed bug which causes to show duplicated values of internal and external storages [verification] Filesystem and Archive tct - 100% pass. Change-Id: Ic087583a906eecfa040d97cb903f4c99838c6591 Signed-off-by: Rafal Walczyna --- diff --git a/src/filesystem/js/common.js b/src/filesystem/js/common.js index 2a62d994..1e4efbe6 100644 --- a/src/filesystem/js/common.js +++ b/src/filesystem/js/common.js @@ -446,7 +446,16 @@ var commonFS_ = (function() { for (var key in cacheVirtualToReal) { if (cacheVirtualToReal.hasOwnProperty(key)) { - ret.push(cloneStorage(cacheVirtualToReal[key])); + var found = false; + for (var i = 0; i < cacheStorages.length; ++i) { + if (key === ret[i].label) { + found = true; + break; + } + } + if (found === false) { + ret.push(cloneStorage(cacheVirtualToReal[key])); + } } }