Close the websocket network when CryptGet/CryptPut is done

This commit is contained in:
yflory 2017-03-03 12:48:00 +01:00
parent a68acac13b
commit ed9bcca96f
1 changed files with 4 additions and 0 deletions

View File

@ -12,6 +12,8 @@ define([
S.cb(err, doc);
S.done = true;
var disconnect = Cryptpad.find(S, ['network', 'disconnect']);
if (typeof(disconnect) === 'function') { disconnect(); }
var abort = Cryptpad.find(S, ['realtime', 'realtime', 'abort']);
if (typeof(abort) === 'function') {
S.realtime.realtime.sync();
@ -50,6 +52,7 @@ define([
var onReady = config.onReady = function (info) {
var rt = Session.session = info.realtime;
Session.network = info.network;
finish(Session, void 0, rt.getUserDoc());
};
overwrite(config, opt);
@ -66,6 +69,7 @@ define([
var Session = { cb: cb, };
config.onReady = function (info) {
var realtime = Session.session = info.realtime;
Session.network = info.network;
TextPatcher.create({
realtime: realtime,