From fcf67c0d0d993ee9f1bc2bad7333c0e512ad2df3 Mon Sep 17 00:00:00 2001 From: tch1001 Date: Fri, 6 Oct 2023 17:24:10 +0800 Subject: [PATCH] hopefully fixed the disappearing ui bug --- src/components/Navbar.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 2ec2bcd..303f791 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -146,7 +146,11 @@ export default defineComponent({ mounted() { sdk.toSession().then(({ data }) => { this.session = data; - this.$store.commit("update_kratos_user_id", data.identity.id); + if(data == null || data.identity == null) { + this.$store.commit("update_kratos_user_id", "guest"); + }else{ + this.$store.commit("update_kratos_user_id", data.identity.id); + } sdk.createSelfServiceLogoutFlowUrlForBrowsers().then(({ data }) => { this.logoutUrl = data.logout_url; });