diff --git a/src/lib/components/shop/CharacterOutfits.svelte b/src/lib/components/shop/CharacterOutfits.svelte index 32a17bdb..e1b7f284 100644 --- a/src/lib/components/shop/CharacterOutfits.svelte +++ b/src/lib/components/shop/CharacterOutfits.svelte @@ -14,7 +14,7 @@ export let recentlyBuyIndex = -1; - const purchasableOutfit = outfits.filter(({ version }) => !!version); + const purchasableOutfit = outfits.filter(({ version }) => version <= parseFloat($patchVersion)); const outfitsData = [...purchasableOutfit].reverse().map((outfit) => { outfit.isOwned = localOutfits.check(outfit.name); const promo = outfit.promoPrice && outfit.promoPrice !== outfit.price; diff --git a/src/lib/components/shop/ShopNavbar.svelte b/src/lib/components/shop/ShopNavbar.svelte index c386eb12..3f43f295 100644 --- a/src/lib/components/shop/ShopNavbar.svelte +++ b/src/lib/components/shop/ShopNavbar.svelte @@ -10,8 +10,9 @@ export let show; let activeShop = 'genesis'; - $: check = outfits.filter(({ version }) => version?.toString() === $patchVersion); - $: outfitsPromo = check.length > 0; + const outfitList = outfits.filter(({ version }) => version <= parseFloat($patchVersion)); + const versionHasOutfit = outfitList.length > 0; + const outfitsPromo = outfitList.find(({ version }) => version === parseFloat($patchVersion)); const dispatch = createEventDispatcher(); const handleClick = (shop) => { @@ -43,17 +44,21 @@ {$t('shop.recomendedHeading')} - handleClick('outfits')} - > - {#if outfitsPromo} - - {/if} - {$t('outfit.heading')} - + + {#if versionHasOutfit} + handleClick('outfits')} + > + {#if outfitsPromo} + + {/if} + {$t('outfit.heading')} + + {/if} +