Fix userlist and chat after reconnection in a shared worker

pull/1/head
yflory 6 years ago
parent 652583eec1
commit 9b9cedd191

@ -965,6 +965,7 @@ define([
if (channel.padChan !== padChan) { return; }
if (channel.wc) { channel.wc.leave(); }
channel.stopped = true;
delete channels[chatChan];
return true;
});
};

@ -133,7 +133,7 @@ define(['json.sortify'], function (Sortify) {
if (idx === -1) { console.log('Error: ' + ev + ' not in members'); return; }
members.splice(idx, 1);
if (!meta.user) { return; }
change(false);
change(true);
});
sframeChan.on('EV_RT_DISCONNECT', function () {
members = [];

@ -1262,9 +1262,15 @@ define([
var messengerEventClients = [];
var dropChannel = function (chanId) {
try {
store.messenger.leavePad(chanId);
} catch (e) { console.error(e); }
try {
store.cursor.leavePad(chanId);
} catch (e) { console.error(e); }
try {
store.onlyoffice.leavePad(chanId);
} catch (e) { console.error(e); }
if (!Store.channels[chanId]) { return; }
@ -1283,8 +1289,12 @@ define([
if (messengerIdx !== -1) {
messengerEventClients.splice(messengerIdx, 1);
}
try {
store.cursor.removeClient(clientId);
} catch (e) { console.error(e); }
try {
store.onlyoffice.removeClient(clientId);
} catch (e) { console.error(e); }
Object.keys(Store.channels).forEach(function (chanId) {
var chanIdx = Store.channels[chanId].clients.indexOf(clientId);

@ -533,6 +533,7 @@ define([
}
};
cpNfInner.metadataMgr.onChange(checkReady);
cpNfInner.metadataMgr.onChange(onLocal);
checkReady();
var infiniteSpinnerModal = false;

@ -269,6 +269,9 @@ define([
sessionStorage[Utils.Constants.displayPadCreationScreen];
delete sessionStorage[Utils.Constants.displayPadCreationScreen];
var updateMeta = function () {
// TODO availableHashes in privateData may need updates once we have
// a better privileges workflow
//console.log('EV_METADATA_UPDATE');
var metaObj, isTemplate;
nThen(function (waitFor) {

Loading…
Cancel
Save