Skip to content

Commit

Permalink
fix checking data logic for surveyComparisonCard
Browse files Browse the repository at this point in the history
  • Loading branch information
jiji14 committed May 25, 2024
1 parent a3570d6 commit 084224e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions www/js/metrics/SurveyComparisonCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ const SurveyComparisonCard = ({ userMetrics, aggMetrics }: Props) => {
style={cardStyles.title(colors)}
/>
<Card.Content style={cardStyles.content}>
{myResponsePct ? (
{typeof myResponsePct !== 'number' || typeof othersResponsePct !== 'number' ? (
<Text variant="labelMedium" style={{ textAlign: 'center', margin: 'auto' }}>
{t('metrics.chart-no-data')}
</Text>
) : (
<View>
<Text style={styles.chartTitle}>{t('main-metrics.survey-response-rate')}</Text>
<View style={styles.chartWrapper}>
Expand All @@ -130,10 +134,6 @@ const SurveyComparisonCard = ({ userMetrics, aggMetrics }: Props) => {
</View>
<LabelPanel first={t('main-metrics.you')} second={t('main-metrics.others')} />
</View>
) : (
<Text variant="labelMedium" style={{ textAlign: 'center', margin: 'auto' }}>
{t('metrics.chart-no-data')}
</Text>
)}
</Card.Content>
</Card>
Expand Down

0 comments on commit 084224e

Please sign in to comment.