fix(profile): incorrect "pinned post" label shown on other account (#3320)

This commit is contained in:
nove-b 2025-06-30 00:28:36 +09:00 committed by GitHub
parent e12b1d2b6c
commit 548183e14a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -1,7 +1,7 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
const { actions = true, older, newer, hasOlder, hasNewer, main, ...props } = defineProps<{
const { actions = true, older, newer, hasOlder, hasNewer, main, account, ...props } = defineProps<{
status: mastodon.v1.Status
followedTag?: string | null
actions?: boolean
@ -20,6 +20,7 @@ const { actions = true, older, newer, hasOlder, hasNewer, main, ...props } = def
// When looking into a detailed view of a post, we can simplify the replying badges
// to the main expanded post
main?: mastodon.v1.Status
account?: mastodon.v1.Account
}>()
const userSettings = useUserSettings()
@ -60,7 +61,10 @@ const timeago = useTimeAgo(() => status.value.createdAt, timeAgoOptions)
const isSelfReply = computed(() => status.value.inReplyToAccountId === status.value.account.id)
const collapseRebloggedBy = computed(() => rebloggedBy.value?.id === status.value.account.id)
const isDM = computed(() => status.value.visibility === 'direct')
const isPinned = computed(() => status.value.pinned)
const isPinned = computed(
() =>
!!props.status.pinned && account?.id === status.value.account.id,
)
const showUpperBorder = computed(() => newer && !directReply.value)
const showReplyTo = computed(() => !replyToMain.value && !directReply.value)

View file

@ -39,11 +39,11 @@ function getFollowedTag(status: mastodon.v1.Status): string | null {
<template #default="{ item, older, newer, active }">
<template v-if="virtualScroller">
<DynamicScrollerItem :item="item" :active="active" tag="article">
<StatusCard :followed-tag="getFollowedTag(item)" :status="item" :context="context" :older="older" :newer="newer" />
<StatusCard :followed-tag="getFollowedTag(item)" :status="item" :context="context" :older="older" :newer="newer" :account="account" />
</DynamicScrollerItem>
</template>
<template v-else>
<StatusCard :followed-tag="getFollowedTag(item)" :status="item" :context="context" :older="older" :newer="newer" />
<StatusCard :followed-tag="getFollowedTag(item)" :status="item" :context="context" :older="older" :newer="newer" :account="account" />
</template>
</template>
<template v-if="context === 'account' " #done="{ items }">