fix: handle pinned comments from backend

This commit is contained in:
Tim
2025-08-14 17:21:08 +08:00
parent 1f9ae8d057
commit 47134cadc2
2 changed files with 3 additions and 3 deletions

View File

@@ -265,7 +265,7 @@ const {
time: TimeManager.format(
selectedTopic.value === '最新回复' ? p.lastReplyAt || p.createdAt : p.createdAt,
),
pinned: !!p.pinnedAt,
pinned: Boolean(p.pinned ?? p.pinnedAt ?? p.pinned_at),
type: p.type,
}))
},
@@ -308,7 +308,7 @@ const fetchNextPage = async () => {
time: TimeManager.format(
selectedTopic.value === '最新回复' ? p.lastReplyAt || p.createdAt : p.createdAt,
),
pinned: !!p.pinnedAt,
pinned: Boolean(p.pinned ?? p.pinnedAt ?? p.pinned_at),
type: p.type,
}))
articles.value.push(...mapped)