mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-13 02:53:50 +00:00
fix(#60): Unsubscribe to basket store after logging out
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user