Fix missing callback of #2400 and ignore missing author on timeslider on client-side
This commit is contained in:
parent
a645aeef5c
commit
9cf19b99fe
|
@ -1020,7 +1020,12 @@ function handleClientReady(client, message)
|
||||||
{
|
{
|
||||||
authorManager.getAuthor(authorId, function(err, author)
|
authorManager.getAuthor(authorId, function(err, author)
|
||||||
{
|
{
|
||||||
if(ERR(err, callback) || !author) return;
|
if(!author && !err)
|
||||||
|
{
|
||||||
|
messageLogger.error("There is no author for authorId:", authorId);
|
||||||
|
return callback();
|
||||||
|
}
|
||||||
|
if(ERR(err, callback)) return;
|
||||||
historicalAuthorData[authorId] = {name: author.name, colorId: author.colorId}; // Filter author attribs (e.g. don't send author's pads to all clients)
|
historicalAuthorData[authorId] = {name: author.name, colorId: author.colorId}; // Filter author attribs (e.g. don't send author's pads to all clients)
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
|
|
|
@ -177,23 +177,26 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
|
||||||
var colorsAnonymous = [];
|
var colorsAnonymous = [];
|
||||||
_.each(authors, function(author)
|
_.each(authors, function(author)
|
||||||
{
|
{
|
||||||
var authorColor = clientVars.colorPalette[author.colorId] || author.colorId;
|
if(author)
|
||||||
if (author.name)
|
|
||||||
{
|
{
|
||||||
if (numNamed !== 0) authorsList.append(', ');
|
var authorColor = clientVars.colorPalette[author.colorId] || author.colorId;
|
||||||
|
if (author.name)
|
||||||
$('<span />')
|
{
|
||||||
.text(author.name || "unnamed")
|
if (numNamed !== 0) authorsList.append(', ');
|
||||||
.css('background-color', authorColor)
|
|
||||||
.addClass('author')
|
$('<span />')
|
||||||
.appendTo(authorsList);
|
.text(author.name || "unnamed")
|
||||||
|
.css('background-color', authorColor)
|
||||||
|
.addClass('author')
|
||||||
|
.appendTo(authorsList);
|
||||||
|
|
||||||
numNamed++;
|
numNamed++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
numAnonymous++;
|
numAnonymous++;
|
||||||
if(authorColor) colorsAnonymous.push(authorColor);
|
if(authorColor) colorsAnonymous.push(authorColor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (numAnonymous > 0)
|
if (numAnonymous > 0)
|
||||||
|
|
Loading…
Reference in New Issue