|
|
@ -2622,22 +2622,28 @@ define([
|
|
|
|
// "cb" is wrapped in Util.once() and may have already been called
|
|
|
|
// "cb" is wrapped in Util.once() and may have already been called
|
|
|
|
// if we have a local cache
|
|
|
|
// if we have a local cache
|
|
|
|
var onReady = function (clientId, returned, cb) {
|
|
|
|
var onReady = function (clientId, returned, cb) {
|
|
|
|
console.error('READY');
|
|
|
|
|
|
|
|
store.ready = true;
|
|
|
|
store.ready = true;
|
|
|
|
var proxy = store.proxy;
|
|
|
|
var proxy = store.proxy;
|
|
|
|
var manager = store.manager;
|
|
|
|
var manager = store.manager;
|
|
|
|
var userObject = store.userObject;
|
|
|
|
var userObject = store.userObject;
|
|
|
|
|
|
|
|
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
if (manager) { return; }
|
|
|
|
|
|
|
|
if (!proxy.settings) { proxy.settings = NEW_USER_SETTINGS; }
|
|
|
|
if (!proxy.settings) { proxy.settings = NEW_USER_SETTINGS; }
|
|
|
|
if (!proxy.friends_pending) { proxy.friends_pending = {}; }
|
|
|
|
if (!proxy.friends_pending) { proxy.friends_pending = {}; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Call onCacheReady if the manager is not yet defined
|
|
|
|
|
|
|
|
if (!manager) {
|
|
|
|
onCacheReady(clientId, waitFor());
|
|
|
|
onCacheReady(clientId, waitFor());
|
|
|
|
manager = store.manager;
|
|
|
|
manager = store.manager;
|
|
|
|
userObject = store.userObject;
|
|
|
|
userObject = store.userObject;
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Initialize RPC in parallel of onCacheReady in case a shared folder
|
|
|
|
|
|
|
|
// is RESTRICTED and requires RPC authentication
|
|
|
|
initAnonRpc(null, null, waitFor());
|
|
|
|
initAnonRpc(null, null, waitFor());
|
|
|
|
initRpc(null, null, waitFor());
|
|
|
|
initRpc(null, null, waitFor());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update loading progress
|
|
|
|
postMessage(clientId, 'LOADING_DRIVE', {
|
|
|
|
postMessage(clientId, 'LOADING_DRIVE', {
|
|
|
|
type: 'migrate',
|
|
|
|
type: 'migrate',
|
|
|
|
progress: 0
|
|
|
|
progress: 0
|
|
|
|