mirror of https://github.com/xwiki-labs/cryptpad
Close the websocket network when CryptGet/CryptPut is done
This commit is contained in:
parent
a68acac13b
commit
ed9bcca96f
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue