auth loader

This commit is contained in:
2023-05-20 07:13:06 +02:00
parent b0224826ec
commit 1f38d6a1ac
4 changed files with 20 additions and 5 deletions

View File

@@ -19,6 +19,7 @@ const signedIn = ref<boolean>(false)
const closeAuthModal = async (close: () => Promise<boolean>) => {
await close()
signedIn.value = true
redirectPending.value = false
}
watch(user, () => {
if (!user.value) signedIn.value = false
@@ -48,12 +49,12 @@ const redirectPending = ref<boolean>(isPendingRedirect())
>
<i class="fas fa-plus-circle text-[1.1rem]" />
</button>
<Modal v-if="!signedIn" v-model="redirectPending">
<Modal v-if="!signedIn" :open="redirectPending">
<template #activator="{ open }">
<button class="btn-outline btn-sm btn py-1 text-white" @click="open">Sign in</button>
</template>
<template #default="{ close }">
<Auth @signedIn="closeAuthModal(close)" />
<Auth :authenticating="redirectPending" @signedIn="closeAuthModal(close)" />
</template>
<template #actions="{ close }">
<button class="btn-sm btn" @click="close">Close</button>