diff options
author | mat <github@matdoes.dev> | 2022-12-25 21:02:26 -0600 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-12-25 21:02:26 -0600 |
commit | b8cb6ae674690d8b0a549574eb8b2401e7da6165 (patch) | |
tree | 419387db779cff0712b5a4f51570d9507d60e7a3 | |
parent | 2fd896f6c7b378d614cf3ec3986bc63aa0ca4977 (diff) | |
download | skyblock-stats-b8cb6ae674690d8b0a549574eb8b2401e7da6165.tar.gz skyblock-stats-b8cb6ae674690d8b0a549574eb8b2401e7da6165.tar.bz2 skyblock-stats-b8cb6ae674690d8b0a549574eb8b2401e7da6165.zip |
fix auctions incorrectly having "show more" sometimes
-rw-r--r-- | src/routes/player/[player]/[profile]/sections/Auctions.svelte | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/routes/player/[player]/[profile]/sections/Auctions.svelte b/src/routes/player/[player]/[profile]/sections/Auctions.svelte index 50d47b6..bec9873 100644 --- a/src/routes/player/[player]/[profile]/sections/Auctions.svelte +++ b/src/routes/player/[player]/[profile]/sections/Auctions.svelte @@ -17,6 +17,7 @@ let onlyThisProfile = true let auctions: any[] = [] + let shownAuctions: any[] = [] let loading = true let page = 0 @@ -32,6 +33,9 @@ ).then(r => r.json()) loading = false auctions = [...auctions, ...auctionsResponse.auctions] + shownAuctions = onlyThisProfile + ? auctions.filter(a => a.sellerProfileUuid == data.profile.uuid) + : auctions totalPages = auctionsResponse.pages } @@ -55,10 +59,10 @@ </ul> <div class="player-auctions-list-container"> - {#if loading || auctions.length > 0} + {#if loading || shownAuctions.length > 0} <h3>Auctions sold</h3> {/if} - {#if auctions.length > 0} + {#if shownAuctions.length > 0} <div class="player-auctions-list"> {#each auctions as auction} {#if !onlyThisProfile || auction.sellerProfileUuid == data.profile.uuid} |