From b8cb6ae674690d8b0a549574eb8b2401e7da6165 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 25 Dec 2022 21:02:26 -0600 Subject: fix auctions incorrectly having "show more" sometimes --- src/routes/player/[player]/[profile]/sections/Auctions.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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 @@
- {#if loading || auctions.length > 0} + {#if loading || shownAuctions.length > 0}

Auctions sold

{/if} - {#if auctions.length > 0} + {#if shownAuctions.length > 0}
{#each auctions as auction} {#if !onlyThisProfile || auction.sellerProfileUuid == data.profile.uuid} -- cgit