diff --git a/www/common/mergeDrive.js b/www/common/mergeDrive.js index 396798d24..9247656e1 100644 --- a/www/common/mergeDrive.js +++ b/www/common/mergeDrive.js @@ -65,7 +65,9 @@ define([ if (!proxy.FS_hashes || !Array.isArray(proxy.FS_hashes)) { proxy.FS_hashes = []; } - proxy.FS_hashes.push(fsHash); + if (proxy.FS_hashes.indexOf(fsHash) === -1) { + proxy.FS_hashes.push(fsHash); + } if (typeof(cb) === "function") { Realtime.whenRealtimeSyncs(proxyData.realtime, cb); } diff --git a/www/common/migrate-user-object.js b/www/common/migrate-user-object.js index 2f1ea5e88..faef141a0 100644 --- a/www/common/migrate-user-object.js +++ b/www/common/migrate-user-object.js @@ -176,6 +176,16 @@ define([ if (version < 7) { addRoHref(); } + }).nThen(function () { + // Migration 8: remove duplicate entries in proxy.FS_hashes (list of migrated anon drives) + var fixDuplicate = function () { + userObject.FS_hashes = Util.deduplicateString(userObject.FS_hashes); + }; + if (version < 8) { + fixDuplicate(); + Feedback.send('Migrate-8', true); + userObject.version = version = 8; + } /*}).nThen(function (waitFor) { // Test progress bar in the loading screen var i = 0;