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

@@ -1,6 +1,8 @@
<script setup lang="ts">
const supabase = useSupabaseAuthClient();
const notifyStore = useNotifyStore();
const loading = ref(false)
const password = ref('')
const confirmPassword = ref('')
@@ -13,11 +15,11 @@
});
if (error) throw error
else {
alert('password changed');
notifyStore.notify("password changed", NotificationType.Success);
navigateTo('/signin', {replace: true}); // navigate to signin because it is best practice although the auth session seems to be valid so it immediately redirects to dashboard
}
} catch (error) {
alert(error)
notifyStore.notify(error, NotificationType.Error);
} finally {
loading.value = false
}