diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index e33c5f429..2084cb1e1 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -2271,6 +2271,7 @@ define([ var channelIsReady = waitFor(); + updateLocalVersion(); var msgEv = Util.mkEvent(); var postMsg, worker; @@ -2504,7 +2505,6 @@ define([ AppConfig.afterLogin(common, waitFor()); } }).nThen(function () { - updateLocalVersion(); f(void 0, env); if (typeof(window.onhashchange) === 'function') { window.onhashchange(); } }); diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 63a7fc352..ccf179245 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -2687,7 +2687,8 @@ define([ // every user object should have a persistent, random number if (typeof(proxy.loginToken) !== 'number') { - proxy[Constants.tokenKey] = Math.floor(Math.random()*Number.MAX_SAFE_INTEGER); + proxy[Constants.tokenKey] = store.data.localToken || + Math.floor(Math.random()*Number.MAX_SAFE_INTEGER); } returned[Constants.tokenKey] = proxy[Constants.tokenKey]; @@ -2848,11 +2849,14 @@ define([ store.driveMetadata = info.metadata; if (!rt.proxy.drive || typeof(rt.proxy.drive) !== 'object') { rt.proxy.drive = {}; } var drive = rt.proxy.drive; + /* + // XXX deprecating localStorage migration // Creating a new anon drive: import anon pads from localStorage if ((!drive[Constants.oldStorageKey] || !Array.isArray(drive[Constants.oldStorageKey])) && !drive['filesData']) { drive[Constants.oldStorageKey] = []; } + */ // Drive already exist: return the existing drive, don't load data from legacy store if (store.manager) { // If a cache is loading, make sure it is complete before calling onReady