🎨 Improving error system, fixing profile store, and more stuff

This commit is contained in:
ChatonDeAru
2024-10-04 01:21:45 +02:00
parent 4bc3a58b3e
commit 8f21d3d615
17 changed files with 664 additions and 133 deletions

View File

@@ -6,15 +6,16 @@ defineOptions({
})
const router = useRouter()
const { user, displayName, waitingMailValidation, loading } = useProfile()
const { user, displayName, waitingMailValidation, loading } = storeToRefs(useProfile())
const { auth } = useSupabaseClient<Database>()
const { showErrorPage } = useErrorSystem()
const links = computed(() => {
const tmp = []
if (!user.value) {
if (!user?.value) {
tmp.push({
label: 'S\'inscrire sur FO',
label: 'S\'inscrire',
to: '/join'
})
} else {
@@ -29,10 +30,9 @@ const links = computed(() => {
const signOut = async () => {
const { error } = await auth.signOut()
if (error) console.log(error)
router.push('/')
// TOFIX
showErrorPage(error)
router.push('/')
}
</script>