|
|
@ -2687,7 +2687,8 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
// every user object should have a persistent, random number
|
|
|
|
// every user object should have a persistent, random number
|
|
|
|
if (typeof(proxy.loginToken) !== '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];
|
|
|
|
returned[Constants.tokenKey] = proxy[Constants.tokenKey];
|
|
|
|
|
|
|
|
|
|
|
@ -2848,11 +2849,14 @@ define([
|
|
|
|
store.driveMetadata = info.metadata;
|
|
|
|
store.driveMetadata = info.metadata;
|
|
|
|
if (!rt.proxy.drive || typeof(rt.proxy.drive) !== 'object') { rt.proxy.drive = {}; }
|
|
|
|
if (!rt.proxy.drive || typeof(rt.proxy.drive) !== 'object') { rt.proxy.drive = {}; }
|
|
|
|
var drive = rt.proxy.drive;
|
|
|
|
var drive = rt.proxy.drive;
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
// XXX deprecating localStorage migration
|
|
|
|
// Creating a new anon drive: import anon pads from localStorage
|
|
|
|
// Creating a new anon drive: import anon pads from localStorage
|
|
|
|
if ((!drive[Constants.oldStorageKey] || !Array.isArray(drive[Constants.oldStorageKey]))
|
|
|
|
if ((!drive[Constants.oldStorageKey] || !Array.isArray(drive[Constants.oldStorageKey]))
|
|
|
|
&& !drive['filesData']) {
|
|
|
|
&& !drive['filesData']) {
|
|
|
|
drive[Constants.oldStorageKey] = [];
|
|
|
|
drive[Constants.oldStorageKey] = [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
// Drive already exist: return the existing drive, don't load data from legacy store
|
|
|
|
// Drive already exist: return the existing drive, don't load data from legacy store
|
|
|
|
if (store.manager) {
|
|
|
|
if (store.manager) {
|
|
|
|
// If a cache is loading, make sure it is complete before calling onReady
|
|
|
|
// If a cache is loading, make sure it is complete before calling onReady
|
|
|
|