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

pull/1/head
yflory 8 years ago
parent c62e0f8be0
commit deda40375a

@ -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 () {

@ -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); }

Loading…
Cancel
Save