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) { config.onInit = function (info) {
var privateData = metadataMgr.getPrivateData(); var privateData = metadataMgr.getPrivateData();
metadataMgr.setDegraded(false); // FIXME degraded moded unsupported (no cursor channel)
readOnly = privateData.readOnly; readOnly = privateData.readOnly;

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

@ -216,11 +216,11 @@ MessengerUI, Messages) {
$('<em>').text(Messages.userlist_offline).appendTo($editUsersList); $('<em>').text(Messages.userlist_offline).appendTo($editUsersList);
numberOfEditUsers = '?'; numberOfEditUsers = '?';
numberOfViewUsers = '?'; numberOfViewUsers = '?';
} } else if (metadataMgr.isDegraded()) {
if (metadataMgr.isDegraded()) {
numberOfEditUsers = Math.max(metadataMgr.getChannelMembers().length - 1, 0); numberOfEditUsers = Math.max(metadataMgr.getChannelMembers().length - 1, 0);
numberOfViewUsers = ''; 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 // Update the buttons
@ -231,11 +231,7 @@ MessengerUI, Messages) {
if (!online) { return; } if (!online) { return; }
if (metadataMgr.isDegraded()) { if (metadataMgr.isDegraded()) { return; }
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;
}
// Display the userlist // Display the userlist

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

Loading…
Cancel
Save