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