Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: only display vote number and acceptance if necessary (#806)

Han Gaofea7394558e2
diff --git a/ui/src/pages/Search/components/SearchItem/index.tsx b/ui/src/pages/Search/components/SearchItem/index.tsx
index d9136b80..b1ebca56 100644
--- a/ui/src/pages/Search/components/SearchItem/index.tsx
+++ b/ui/src/pages/Search/components/SearchItem/index.tsx
@@ -76,6 +76,8 @@ const Index: FC<Props> = ({ data }) => {
className="my-2 my-sm-0"
showViews={false}
isAccepted={data.object?.accepted}
+ showAnswers={data.object_type === 'question'}
+ showAccepted={data.object?.accepted && data.object_type === 'answer'}
data={{
votes: data.object?.vote_count,
answers: data.object?.answer_count,