Skip to content

Commit f4910f3

Browse files
author
Kerwin
committed
fix: pop-up window cannot be closed on the mobile (Closes #48)
1 parent 14c323c commit f4910f3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/components/common/UserAvatar/index.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ import { useBasicLayout } from '@/hooks/useBasicLayout'
99
1010
const userStore = useUserStore()
1111
const authStore = useAuthStore()
12-
const needPermission = ref(false)
13-
1412
const { isMobile } = useBasicLayout()
15-
if (!!authStore.session?.auth && !authStore.token)
16-
needPermission.value = isMobile.value
13+
const showPermission = ref(false)
14+
15+
const needPermission = computed(() => !!authStore.session?.auth && !authStore.token && (isMobile.value || showPermission.value))
1716
1817
const userInfo = computed(() => userStore.userInfo)
1918
</script>
@@ -39,7 +38,7 @@ const userInfo = computed(() => userStore.userInfo)
3938
</h2>
4039
<NButton
4140
v-else tag="a" text
42-
@click="needPermission = true"
41+
@click="showPermission = true"
4342
>
4443
<span class="text-xl text-[#ff69b4] dark:text-white">
4544
{{ $t('common.notLoggedIn') }}

0 commit comments

Comments
 (0)