ui: Ensure $teams is correctly populated
This commit is contained in:
parent
5d36c8a2c2
commit
2b87449475
@ -84,7 +84,7 @@
|
||||
{#if $my && $my.team_id}
|
||||
<NavItem>
|
||||
{Math.round($my.score*100)/100} {$my.score === 1 ? 'point' : 'points'}
|
||||
{#if $teams && $teams[$my.team_id].rank}
|
||||
{#if $teams && $teams[$my.team_id] && $teams[$my.team_id].rank}
|
||||
– {$teams[$my.team_id].rank}<sup>e</sup> sur {Object.keys($teams).length}
|
||||
{/if}
|
||||
</NavItem>
|
||||
@ -94,10 +94,16 @@
|
||||
<Badge href="register" color="warning">
|
||||
Inscription
|
||||
</Badge>
|
||||
{:else if $my.team_id && $teams}
|
||||
{:else if $my.team_id}
|
||||
{#if $teams && $teams[$my.team_id]}
|
||||
<Badge href="edit" style="background-color: {$teams[$my.team_id].color} !important; color: {$teams[$my.team_id].color};">
|
||||
<span class="teamname">{$my.name}</span>
|
||||
</Badge>
|
||||
{:else}
|
||||
<Badge href="edit" color="info">
|
||||
<span class="teamname">{$my.name}</span>
|
||||
</Badge>
|
||||
{/if}
|
||||
{/if}
|
||||
</NavItem>
|
||||
</Nav>
|
||||
|
Loading…
Reference in New Issue
Block a user