Skip to content

Commit

Permalink
Get the last badge if same id
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaserlang committed Nov 2, 2024
1 parent 0981264 commit d545808
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tbot/web/ui/live_chat/components/badges.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ export function Badges({ channelId, badges }) {
}

function findBadge(badges, set_id, id) {
let b = null;
for (const badge of badges) {
if (badge.set_id === set_id) {
for (const version of badge.versions) {
if (version.id === id) {
return version;
b = version;
}
}
}
}
return b
}

0 comments on commit d545808

Please sign in to comment.