mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
feat: add vue-toastification for alerting
This commit is contained in:
1 parent
2d0fffc8f4
commit
d0e2a4125d
7 files changed
+58
-22
No files matched your search
@@ -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">
|
||||
|
||||
Reference in new issue
Block a user