Make onSettle Async Again

This commit is contained in:
ansuz 2017-02-28 13:12:04 +01:00
parent 3380b13c95
commit 5d39125004

View File

@ -66,11 +66,15 @@ define([
}; };
var whenRealtimeSyncs = common.whenRealtimeSyncs = function (realtime, cb) { var whenRealtimeSyncs = common.whenRealtimeSyncs = function (realtime, cb) {
// FIXME realtime.onSettle should handle this but it doesn't seem to realtime.sync();
if (realtime.getAuthDoc() === realtime.getUserDoc()) { window.setTimeout(function () {
return void cb(); if (realtime.getAuthDoc() === realtime.getUserDoc()) {
} return void cb();
realtime.onSettle(cb); }
realtime.onSettle(function () {
cb();
});
}, 0);
}; };
var getWebsocketURL = common.getWebsocketURL = function () { var getWebsocketURL = common.getWebsocketURL = function () {