Show ... in Navbar during session initialization
This commit is contained in:
parent
cf6f83dad5
commit
10702eb842
|
@ -3,7 +3,8 @@
|
|||
<nav>
|
||||
<router-link to="/">market</router-link>
|
||||
<router-link to="/user" v-if="session.isAuthenticated">user</router-link>
|
||||
<router-link to="/login" v-else href="/login">login</router-link>
|
||||
<router-link to="/login" v-else-if="session.isAuthenticated === false" href="/login">login</router-link>
|
||||
<router-link disabled to="/" v-else>...</router-link>
|
||||
</nav>
|
||||
</header>
|
||||
</template>
|
||||
|
|
|
@ -3,8 +3,8 @@ import { computed, ref } from 'vue'
|
|||
|
||||
export const useSession = defineStore('session', () => {
|
||||
const pubkey = ref(null)
|
||||
const isAuthenticated = computed(() => !!pubkey.value)
|
||||
const initialized = ref(false)
|
||||
const isAuthenticated = computed(() => initialized.value ? !!pubkey.value : undefined)
|
||||
|
||||
function checkSession () {
|
||||
const url = window.origin + '/api/session'
|
||||
|
|
Loading…
Reference in New Issue