fix(#60): Unsubscribe to basket store after logging out

This commit is contained in:
Josh Creek
2024-11-06 17:43:29 +00:00
parent ed6dc6db74
commit 39701b2155
+3 -1
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import { createEventDispatcher, onDestroy } from 'svelte';
import { basket, type Basket, type Item } from '$lib/stores/basket.js';
const dispatch = createEventDispatcher();
@@ -16,6 +16,8 @@
localBasket = value;
});
onDestroy(unsubscribe);
async function signOut() {
// TODO use the error from the response
const { error } = await supabase.auth.signOut().then(() => {