Fix current product detection on Shop location switcher select

This commit is contained in:
2022-06-21 13:38:55 +02:00
parent deb0c1d708
commit 23b0035272
2 changed files with 3 additions and 3 deletions

View File

@@ -1,9 +1,9 @@
<script lang="ts">
import { page } from '$app/stores'
import { goto } from '$app/navigation'
import { getContext } from 'svelte'
export let isOver: boolean = false
export let currentProductSlug: string = undefined
const { shopLocations } = getContext('shop')
@@ -29,7 +29,7 @@
</svg>
<select on:change={quickLocationChange}>
{#each shopLocations as { name, slug }}
<option value={slug} selected={slug === $page.params.name}>{name}</option>
<option value={slug} selected={slug === currentProductSlug}>{name}</option>
{/each}
</select>
</dd>