-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSendVerifyCodeDialog.vue
More file actions
63 lines (59 loc) · 2.04 KB
/
SendVerifyCodeDialog.vue
File metadata and controls
63 lines (59 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<template>
<v-dialog v-model="open" activator="parent">
<v-card>
<v-card-text class="text-center">
<template v-if="loading">
<h2>
<v-icon>
mdi-email-fast
</v-icon>
עובדים על זה...
</h2>
<v-progress-linear color="green" indeterminate />
</template>
<template v-else>
<h2>רק רגע אחד... 🤔</h2>
<p>
בדקת את תיבת הדוא"ל שלך? כן, גם את תיבת הספאם וקידומי מכירות...
</p>
</template>
</v-card-text>
<v-card-actions>
<v-btn color="primary" variant="text" :disabled="loading" @click="sendCodeAndCloseDialog()">
בדקתי ואין שום קוד - בבקשה שלח לי חדש!
</v-btn>
<v-spacer></v-spacer>
<v-btn color="green" variant="text" :disabled="loading" @click="open = false">
מממ... אבדוק שוב ואעדכן :)
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script setup>
import { ref } from 'vue'
import { useSnacksStore } from '@/stores/snacks'
import { useUserStore } from '@/stores/user';
const snacksStore = useSnacksStore();
const userStore = useUserStore();
const open = ref(false);
const loading = ref(false);
const sendCodeAndCloseDialog = async () => {
loading.value = true;
try {
await userStore.sendVerifyEmail();
snacksStore.addSnack({
text: 'קוד אימות נשלח למייל שלך',
color: 'success'
})
} catch (error) {
snacksStore.addSnack({
text: error.message,
color: 'error'
})
} finally {
loading.value = false;
open.value = false;
}
}
</script>