If topic has no contentn redirect to ai tutor

This commit is contained in:
Kamran Ahmed committed 2025-05-21 12:31:33 +01:00
1 parent 9bbf8ea04b
commit a1c564534a
1 file changed
+6 -1
+6 -1
View File
@@ -316,12 +316,17 @@ export function TopicDetail(props: TopicDetailProps) {
}
topicHtml = topicDom.body.innerHTML;
const topicHasContent = otherElems.length > 0;
setLinks(listLinks);
setHasContent(otherElems.length > 0);
setHasContent(topicHasContent);
setContributionUrl(contributionUrl);
setHasEnoughLinks(links.length >= 3);
setTopicHtmlTitle(titleElem?.textContent || '');
if (!topicHasContent && renderer === 'editor') {
setActiveTab('ai');
}
} else {
setLinks((response as RoadmapContentDocument)?.links || []);
setTopicTitle((response as RoadmapContentDocument)?.title || '');