feat: add vue-toastification for alerting

This commit is contained in:
wancat authored and Lin, Hung-Shin committed 2023-11-14 10:45:24 +08:00
1 parent 2d0fffc8f4
commit d0e2a4125d
7 files changed
+58 -22

No files matched your search

+10 -8
View File
@@ -1,17 +1,21 @@
<script setup>
import { useRouter } from 'vue-router'
import { useToast } from 'vue-toastification'
import { logout } from '../utils/auth'
import { bugReportUrl } from '../config'
import sessionStore, { reset } from '../store/session'
const router = useRouter()
const toast = useToast()
const handleLogout = async () => {
try {
await logout()
reset()
router.push({ name: 'login' })
} catch (err) {
toast.error('Failed to logout')
console.error(err)
}
}
@@ -33,14 +37,12 @@ const handleLogout = async () => {
class="text-text-tertiary h-full w-full"
/>
</button> -->
<button>
<p
class="text-text-primary inline-block font-bold whitespace-nowrap"
v-if="sessionStore.quest"
>
{{ sessionStore.quest.title }}
</p>
</button>
<p
class="text-text-primary inline-block font-bold whitespace-nowrap"
v-if="sessionStore.quest"
>
{{ sessionStore.quest.title }}
</p>
</div>
<div class="h-full w-full flex gap-3 items-center justify-end">
<!-- <button id="warning" class="flex items-center h-5 w-5">