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(HotQuestions): Automatically hide the `HotQuestions` module when no data is available

haitaoo7d722cde4f1d
diff --git a/ui/src/components/HotQuestions/index.tsx b/ui/src/components/HotQuestions/index.tsx
index 40ffbb27..ecc74d14 100644
--- a/ui/src/components/HotQuestions/index.tsx
+++ b/ui/src/components/HotQuestions/index.tsx
@@ -10,7 +10,9 @@ import { useHotQuestions } from '@/services';
const HotQuestions: FC = () => {
const { t } = useTranslation('translation', { keyPrefix: 'question' });
const { data: questionRes } = useHotQuestions();
-
+ if (!questionRes?.list?.length) {
+ return null;
+ }
return (
<Card>
<Card.Header className="text-nowrap text-capitalize">