Skip to content

Commit

Permalink
feat: add in no player data found message if no leaders
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinHerber committed Jul 10, 2024
1 parent 50c3cf5 commit 7bb741b
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/routes/leaderboards/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,21 @@
<TableBodyCell>Data...</TableBodyCell>
</TableBodyRow>
{:then leaders}
{#each leaders as leader}
{#if leaders.length === 0}
<TableBodyRow>
<TableBodyCell>{leader.name}</TableBodyCell>
<TableBodyCell>{leader.stats.level}</TableBodyCell>
<TableBodyCell>{leader.stats.experience}</TableBodyCell>
<TableBodyCell>No</TableBodyCell>
<TableBodyCell>player data</TableBodyCell>
<TableBodyCell>found</TableBodyCell>
</TableBodyRow>
{/each}
{:else}
{#each leaders as leader}
<TableBodyRow>
<TableBodyCell>{leader.name}</TableBodyCell>
<TableBodyCell>{leader.stats.level}</TableBodyCell>
<TableBodyCell>{leader.stats.experience}</TableBodyCell>
</TableBodyRow>
{/each}
{/if}
{:catch someError}
Failed to load leaderboards
{/await}
Expand Down

0 comments on commit 7bb741b

Please sign in to comment.