diff --git a/assets/components/PersonalizeHomeModal.tsx b/assets/components/PersonalizeHomeModal.tsx index 59eb3b776..b071cdb15 100644 --- a/assets/components/PersonalizeHomeModal.tsx +++ b/assets/components/PersonalizeHomeModal.tsx @@ -172,12 +172,14 @@ class PersonalizeHomeModal extends React.Component { const topicSearch = (searchMatches?.length ?? 0) > 0 ? ( -
+
{searchMatches}
- ) : ; + ) : null; + + const hasTopics = (filteredTopics(this.wireTopics).length ?? 0) > 0; - const groupedTopics = (this.props.topics?.length ?? 0) > 0 ? ( + const groupedTopics = hasTopics ? (
{filteredTopics(this.wireTopics).map((wireTopic) => ( @@ -309,7 +311,7 @@ class PersonalizeHomeModal extends React.Component {
- {this.state.searchTerm ? topicSearch : groupedTopics} + {this.state.searchTerm && hasTopics ? topicSearch : groupedTopics}
{ const paramRegexp = new RegExp('{{ ?' + param + ' ?}}', 'g'); - translated = translated.replace(paramRegexp, params[param] || ''); + translated = translated.replace(paramRegexp, params[param] != null ? params[param] : ''); }); }