diff options
author | mat <github@matdoes.dev> | 2022-07-01 16:37:57 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-07-01 16:37:57 -0500 |
commit | b4817dc7391beafa80e69c8e4ecc46e522be1962 (patch) | |
tree | 889ccb30d2ffe7bacc0159454aaeb74aa4d7c054 | |
parent | c98d4c8ac700b89e10c785d887d49f078a6bb228 (diff) | |
download | skyblock-stats-b4817dc7391beafa80e69c8e4ecc46e522be1962.tar.gz skyblock-stats-b4817dc7391beafa80e69c8e4ecc46e522be1962.tar.bz2 skyblock-stats-b4817dc7391beafa80e69c8e4ecc46e522be1962.zip |
Improve hide/show auctions button
-rw-r--r-- | src/lib/sections/Auctions.svelte | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/lib/sections/Auctions.svelte b/src/lib/sections/Auctions.svelte index cf128c9..827b06b 100644 --- a/src/lib/sections/Auctions.svelte +++ b/src/lib/sections/Auctions.svelte @@ -20,17 +20,17 @@ </script> <div class="player-auctions-list-container"> - <button - on:click={() => { - showingSoldAuctions = !showingSoldAuctions - }}>{showingSoldAuctions ? 'Hide' : 'Show'} sold auctions</button - > - {#if showingSoldAuctions} {#await fetchApi(`playerauctions/${data.member.uuid}`, fetch).then(r => r.json())} Loading... {:then auctions} {#if auctions.length > 0} + <button + on:click={() => { + showingSoldAuctions = !showingSoldAuctions + }}>Hide sold auctions</button + > + <div class="player-auctions-list"> {#each auctions as auction} {#if !onlyThisProfile || auction.sellerProfileUuid == data.profile.uuid} @@ -56,6 +56,12 @@ </div> {/if} {/await} + {:else} + <button + on:click={() => { + showingSoldAuctions = !showingSoldAuctions + }}>Show sold auctions</button + > {/if} </div> |