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