mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-08 23:36:44 +02:00
fix: dont allow adding duplicates to userFilter
This commit is contained in:
@@ -60,9 +60,11 @@ define('userFilter', ['api', 'hooks', 'slugify'], function (api, hooks, slugify)
|
||||
el.find('[component="user/filter/results"]').html(html);
|
||||
console.log('render results');
|
||||
el.find('[component="user/filter/results"] [data-uid]').on('click', async function () {
|
||||
console.log('wtf?');
|
||||
selectedUsers.push(uidToUser[$(this).attr('data-uid')]);
|
||||
await onSelectionChange();
|
||||
const clickedUid = parseInt($(this).attr('data-uid'), 10);
|
||||
if (!selectedUsers.find(u => u.uid === clickedUid)) {
|
||||
selectedUsers.push(uidToUser[$(this).attr('data-uid')]);
|
||||
await onSelectionChange();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user