Use the new onSettle from chainpad to determine if the realtime is synced

This commit is contained in:
yflory 2017-02-17 10:31:07 +01:00
parent c62e0f8be0
commit deda40375a
2 changed files with 1 additions and 9 deletions

View file

@ -46,14 +46,7 @@ define([
var whenRealtimeSyncs = common.whenRealtimeSyncs = function (realtime, cb) {
realtime.sync();
var interval = 300;
var check = function () {
if (realtime.getAuthDoc() !== realtime.getUserDoc()) {
return window.setTimeout(check, interval);
}
cb();
};
window.setTimeout(check, interval);
realtime.onSettle(cb);
};
var getWebsocketURL = common.getWebsocketURL = function () {

View file

@ -1873,7 +1873,6 @@ define([
};
var createReadme = function (proxy, cb) {
if (proxy.initializing) {
console.log('test');
var hash = Cryptpad.createRandomHash();
Get.put(hash, Messages.driveReadme, function (e) {
if (e) { console.error(e); }