fix: tapping on avatar should show switcher on mobile

This commit is contained in:
Daniel Roe 2022-11-27 22:57:20 +00:00
parent 9687330dd4
commit 834eca2ad2
No known key found for this signature in database
GPG key ID: 22D5008E4F5D9B55
2 changed files with 2 additions and 11 deletions

View file

@ -24,7 +24,7 @@ const nav = ref<HTMLDivElement>()
</div>
<div flex items-center>
<slot name="actions" />
<NavUser v-if="isSmallScreen" :nav="nav" />
<NavUser v-if="isSmallScreen" />
</div>
</div>
<slot name="header" />

View file

@ -4,16 +4,7 @@ import type { ComponentPublicInstance } from 'vue'
const avatar = ref<ComponentPublicInstance>()
const switcher = ref()
const router = useRouter()
const goProfile = () => {
router.push(`/@${currentUser.value!.account.username}`)
}
let showSwitcher = $ref(false)
onLongPress(avatar, () => {
showSwitcher = true
})
onClickOutside(avatar, () => {
showSwitcher = false
@ -26,6 +17,7 @@ onClickOutside(avatar, () => {
v-model:shown="showSwitcher"
:triggers="[]"
:auto-hide="false"
@click="showSwitcher = true"
>
<div style="-webkit-touch-callout: none;">
<AccountAvatar
@ -33,7 +25,6 @@ onClickOutside(avatar, () => {
:account="currentUser.account"
h="2em"
:draggable="false"
@click.stop="goProfile"
/>
</div>