[filesystem] Fix getAllStorages 97/216997/1
authorRafal Walczyna <r.walczyna@samsung.com>
Tue, 29 Oct 2019 12:58:14 +0000 (13:58 +0100)
committerRafal Walczyna <r.walczyna@samsung.com>
Tue, 5 Nov 2019 09:29:05 +0000 (09:29 +0000)
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 <r.walczyna@samsung.com>
src/filesystem/js/common.js

index 2a62d99..1e4efbe 100644 (file)
@@ -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]));
+                }
             }
         }