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 dirty = true;
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 lazyChangeHandlers = [];
var titleChangeHandlers = [];

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

Loading…
Cancel
Save