Make sure the realtime is synced with onSettle when using cryptget

This commit is contained in:
yflory committed 2017-02-27 14:28:12 +01:00
1 parent fadddb297c
commit 66dc166936
1 file changed
+9 -3
+9 -3
View File
@@ -70,10 +70,16 @@ define([
TextPatcher.create({
realtime: realtime,
})(doc);
realtime.sync();
realtime.abort();
finish(Session, void 0);
var to = window.setTimeout(function () {
cb(new Error("Timeout"));
}, 5000);
Cryptpad.whenRealtimeSyncs(realtime, function () {
window.clearTimeout(to);
realtime.abort();
finish(Session, void 0);
});
};
overwrite(config, opt);