Skip to content

Commit

Permalink
Older patches have no outfit in shop
Browse files Browse the repository at this point in the history
  • Loading branch information
AguzzTN54 committed Feb 13, 2023
1 parent 8e8be08 commit b707eec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/shop/CharacterOutfits.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
31 changes: 18 additions & 13 deletions src/lib/components/shop/ShopNavbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -43,17 +44,21 @@
{$t('shop.recomendedHeading')}
</span>
</a>
<a
href="#outfits"
class="link"
class:active={activeShop === 'outfits'}
on:click|preventDefault={() => handleClick('outfits')}
>
{#if outfitsPromo}
<NoticeMark name="outfits-{$patchVersion}" />
{/if}
<span><i class="gi-outfit" /> {$t('outfit.heading')}</span>
</a>

{#if versionHasOutfit}
<a
href="#outfits"
class="link"
class:active={activeShop === 'outfits'}
on:click|preventDefault={() => handleClick('outfits')}
>
{#if outfitsPromo}
<NoticeMark name="outfits-{$patchVersion}" />
{/if}
<span><i class="gi-outfit" /> {$t('outfit.heading')}</span>
</a>
{/if}

<a
href="#paimon"
class="link"
Expand Down

0 comments on commit b707eec

Please sign in to comment.