Fix userlist in non-degraded apps

pull/1/head
yflory 4 years ago
parent f6015e419e
commit 1a0f06f860

@ -2200,6 +2200,7 @@ define([
config.onInit = function (info) {
var privateData = metadataMgr.getPrivateData();
metadataMgr.setDegraded(false); // FIXME degraded moded unsupported (no cursor channel)
readOnly = privateData.readOnly;

@ -585,6 +585,8 @@ define([
var hjson = normalize(JSON.parse(newContentStr));
evCursorUpdate.fire(data, hjson);
});
} else {
common.getMetadataMgr().setDegraded(false);
}
UI.removeLoadingScreen(emitResize);

@ -216,11 +216,11 @@ MessengerUI, Messages) {
$('<em>').text(Messages.userlist_offline).appendTo($editUsersList);
numberOfEditUsers = '?';
numberOfViewUsers = '?';
}
if (metadataMgr.isDegraded()) {
} else if (metadataMgr.isDegraded()) {
numberOfEditUsers = Math.max(metadataMgr.getChannelMembers().length - 1, 0);
numberOfViewUsers = '';
Messages.toolbar_degraded = "Too many editors are present in the pad. The userlist has been disabled to improve performances"; // XXX
$('<em>').text(Messages.toolbar_degraded).appendTo($editUsersList);
}
// Update the buttons
@ -231,11 +231,7 @@ MessengerUI, Messages) {
if (!online) { return; }
if (metadataMgr.isDegraded()) {
Messages.toolbar_degraded = "Too many editors are present in the pad. The userlist has been disabled to improve performances"; // XXX
$('<em>').text(Messages.toolbar_degraded).appendTo($editUsersList);
return;
}
if (metadataMgr.isDegraded()) { return; }
// Display the userlist

@ -1313,6 +1313,7 @@ define([
}).nThen(function (/* waitFor */) {
Test.registerInner(common.getSframeChannel());
var metadataMgr = common.getMetadataMgr();
metadataMgr.setDegraded(false); // FIXME degarded mode unsupported (no cursor channel)
APP.locked = APP.readOnly = metadataMgr.getPrivateData().readOnly;
APP.loggedIn = common.isLoggedIn();

Loading…
Cancel
Save