From ed9bcca96fa0329fed38b9cdf3f7219a5c395c7f Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 3 Mar 2017 12:48:00 +0100 Subject: [PATCH] Close the websocket network when CryptGet/CryptPut is done --- www/common/cryptget.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/common/cryptget.js b/www/common/cryptget.js index 80feacec0..0c73fa45b 100644 --- a/www/common/cryptget.js +++ b/www/common/cryptget.js @@ -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,