feat(#29): Remove checkout button when not signed in

This commit is contained in:
Josh Creek
2024-09-21 20:51:00 +01:00
parent 05891ad510
commit a4764c547e
+8
View File
@@ -3,6 +3,10 @@
import { basket, type Basket, type Item } from '$lib/stores/basket.js';
import BasketItem from '$lib/components/checkout/BasketItem.svelte';
export let data;
let { supabase, session, url } = data;
$: ({ supabase, session, url } = data);
let localBasket: Basket;
const unsubscribe = basket.subscribe((value) => {
localBasket = value;
@@ -101,6 +105,7 @@
/>
</svg>
</a>
{#if session?.user !== undefined}
<button
type="submit"
class="btn btn-primary"
@@ -123,6 +128,9 @@
/>
</svg>
</button>
{:else}
<p>You must sign in to checkout</p>
{/if}
</div>
</form>
</div>