fix watchers JS again

prod
Thibault Duplessis 2020-09-02 09:20:14 +02:00
parent b7e437cf46
commit 05cd82a7f2
1 changed files with 3 additions and 3 deletions

View File

@ -10,9 +10,9 @@ lichess.widget('watchers', {
if (!data || !data.nb) return this.element.addClass('none');
if (this.number.length) this.number.text(data.nb);
if (data.users) {
const tags = data.users.map(u => {
u ? `<a class="user-link ulpt" href="/@/${u.includes(' ') ? u.split(' ')[1] : u}">${u}</a>` : 'Anonymous';
});
const tags = data.users.map(u =>
u ? `<a class="user-link ulpt" href="/@/${u.includes(' ') ? u.split(' ')[1] : u}">${u}</a>` : 'Anonymous'
);
if (data.anons === 1) tags.push('Anonymous');
else if (data.anons) tags.push('Anonymous (' + data.anons + ')');
this.list.html(tags.join(', '));