fix: hide actions at self profile

This commit is contained in:
三咲智子 2022-11-26 02:24:46 +08:00
parent 9df9c06f64
commit 373697619f
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E

View file

@ -6,6 +6,8 @@ const { account } = defineProps<{
}>() }>()
let relationship = $(useRelationship(account)) let relationship = $(useRelationship(account))
const isSelf = $computed(() => currentUser.value?.account.id === account.id)
const mute = async () => { const mute = async () => {
// TODO: Add confirmation // TODO: Add confirmation
@ -52,26 +54,28 @@ const unblock = async () => {
</CommonDropdownItem> </CommonDropdownItem>
</NuxtLink> </NuxtLink>
<CommonDropdownItem icon="i-ri:at-line" @click="mentionUser(account)"> <template v-if="!isSelf">
Mention @{{ account.acct }} <CommonDropdownItem icon="i-ri:at-line" @click="mentionUser(account)">
</CommonDropdownItem> Mention @{{ account.acct }}
<CommonDropdownItem icon="i-ri:message-3-line" @click="directMessageUser(account)"> </CommonDropdownItem>
Direct message @{{ account.acct }} <CommonDropdownItem icon="i-ri:message-3-line" @click="directMessageUser(account)">
</CommonDropdownItem> Direct message @{{ account.acct }}
</CommonDropdownItem>
<CommonDropdownItem v-if="!relationship?.muting" icon="i-ri:volume-up-fill" @click="mute"> <CommonDropdownItem v-if="!relationship?.muting" icon="i-ri:volume-up-fill" @click="mute">
Mute @{{ account.acct }} Mute @{{ account.acct }}
</CommonDropdownItem> </CommonDropdownItem>
<CommonDropdownItem v-else icon="i-ri:volume-mute-line" @click="unmute"> <CommonDropdownItem v-else icon="i-ri:volume-mute-line" @click="unmute">
Unmute @{{ account.acct }} Unmute @{{ account.acct }}
</CommonDropdownItem> </CommonDropdownItem>
<CommonDropdownItem v-if="!relationship?.blocking" icon="i-ri:forbid-2-line" @click="block"> <CommonDropdownItem v-if="!relationship?.blocking" icon="i-ri:forbid-2-line" @click="block">
Block @{{ account.acct }} Block @{{ account.acct }}
</CommonDropdownItem> </CommonDropdownItem>
<CommonDropdownItem v-else icon="i-ri:checkbox-circle-line" @click="unblock"> <CommonDropdownItem v-else icon="i-ri:checkbox-circle-line" @click="unblock">
Unblock @{{ account.acct }} Unblock @{{ account.acct }}
</CommonDropdownItem> </CommonDropdownItem>
</template>
</template> </template>
</CommonDropdown> </CommonDropdown>
</template> </template>