replace alerts with notifications using DaisyUI toasts

This commit is contained in:
Michael Dausmann
2023-05-12 23:46:27 +10:00
parent c6b48f05c1
commit 0d2db65f74
7 changed files with 76 additions and 8 deletions

View File

@@ -3,6 +3,7 @@
const supabase = useSupabaseAuthClient();
const accountStore = useAccountStore()
const notifyStore = useNotifyStore();
const loading = ref(false)
const email = ref('')
@@ -15,7 +16,7 @@
const { error } = await supabase.auth.signInWithPassword({ email: email.value, password: password.value })
if (error) throw error
} catch (error) {
alert(error)
notifyStore.notify(error, NotificationType.Error);
} finally {
loading.value = false
}
@@ -28,7 +29,7 @@
const { error } = await supabase.auth.signInWithOAuth({ provider: 'google' })
if (error) throw error
} catch (error) {
alert(error)
notifyStore.notify(error, NotificationType.Error);
} finally {
loading.value = false
}