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.cb(err, doc);
|
||||||
S.done = true;
|
S.done = true;
|
||||||
|
|
||||||
|
var disconnect = Cryptpad.find(S, ['network', 'disconnect']);
|
||||||
|
if (typeof(disconnect) === 'function') { disconnect(); }
|
||||||
var abort = Cryptpad.find(S, ['realtime', 'realtime', 'abort']);
|
var abort = Cryptpad.find(S, ['realtime', 'realtime', 'abort']);
|
||||||
if (typeof(abort) === 'function') {
|
if (typeof(abort) === 'function') {
|
||||||
S.realtime.realtime.sync();
|
S.realtime.realtime.sync();
|
||||||
@ -50,6 +52,7 @@ define([
|
|||||||
|
|
||||||
var onReady = config.onReady = function (info) {
|
var onReady = config.onReady = function (info) {
|
||||||
var rt = Session.session = info.realtime;
|
var rt = Session.session = info.realtime;
|
||||||
|
Session.network = info.network;
|
||||||
finish(Session, void 0, rt.getUserDoc());
|
finish(Session, void 0, rt.getUserDoc());
|
||||||
};
|
};
|
||||||
overwrite(config, opt);
|
overwrite(config, opt);
|
||||||
@ -66,6 +69,7 @@ define([
|
|||||||
var Session = { cb: cb, };
|
var Session = { cb: cb, };
|
||||||
config.onReady = function (info) {
|
config.onReady = function (info) {
|
||||||
var realtime = Session.session = info.realtime;
|
var realtime = Session.session = info.realtime;
|
||||||
|
Session.network = info.network;
|
||||||
|
|
||||||
TextPatcher.create({
|
TextPatcher.create({
|
||||||
realtime: realtime,
|
realtime: realtime,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user