Fix degraded race condition

pull/1/head
yflory 4 years ago
parent 1a0f06f860
commit 38830d262a

@ -15,7 +15,7 @@ define(['json.sortify'], function (Sortify) {
var priv = {}; var priv = {};
var dirty = true; var dirty = true;
var history = false; var history = false;
var degraded = true; var degraded = 1; // truthy value but not true: we don't know yet if we're degraded
var changeHandlers = []; var changeHandlers = [];
var lazyChangeHandlers = []; var lazyChangeHandlers = [];
var titleChangeHandlers = []; var titleChangeHandlers = [];

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

Loading…
Cancel
Save