1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-02 22:02:39 +02:00

If topic has no contentn redirect to ai tutor

This commit is contained in:
Kamran Ahmed
2025-05-21 12:31:33 +01:00
parent 9bbf8ea04b
commit a1c564534a

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 || '');