Async migration

This commit is contained in:
yflory
2018-05-03 17:59:22 +02:00
parent 91860186d1
commit 6c4c5c135b
2 changed files with 133 additions and 96 deletions

View File

@@ -1052,11 +1052,13 @@ define([
postMessage("DRIVE_LOG", msg);
}
});
var todo = function () {
nThen(function (waitFor) {
userObject.migrate(waitFor());
}).nThen(function (waitFor) {
Migrate(proxy, waitFor());
}).nThen(function () {
userObject.fixFiles();
Migrate(proxy);
var requestLogin = function () {
postMessage("REQUEST_LOGIN");
};
@@ -1119,8 +1121,7 @@ define([
proxy.on('change', [Constants.tokenKey], function () {
postMessage("UPDATE_TOKEN", { token: proxy[Constants.tokenKey] });
});
};
userObject.migrate(todo);
});
};
var connect = function (data, cb) {
@@ -1139,7 +1140,7 @@ define([
validateKey: secret.keys.validateKey || undefined,
crypto: Crypto.createEncryptor(secret.keys),
userName: 'fs',
logLevel: 1,
logLevel: 2,
ChainPad: ChainPad,
classic: true,
};