1 export const findResult = (user, round) => {
2 if (!user || !user.id) return null;
3 if (!round || !round.results || !round.results.length) return null;
4 return round.results.find(result => result.user_id == user.id);
7 export const getAvatarUrl = user => user.avatar
8 ? `//cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png`
9 : '/default-avatar.png';
11 export const hasFinishedRound = (user, round) => {
12 const result = findResult(user, round);
13 return result && result.has_finished;