aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-12-25 21:02:26 -0600
committermat <github@matdoes.dev>2022-12-25 21:02:26 -0600
commitb8cb6ae674690d8b0a549574eb8b2401e7da6165 (patch)
tree419387db779cff0712b5a4f51570d9507d60e7a3
parent2fd896f6c7b378d614cf3ec3986bc63aa0ca4977 (diff)
downloadskyblock-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.svelte8
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}