fix/ai-roadmap
Kamran Ahmed 9 months ago
parent 46bfacff92
commit 8dd5b5fecf
  1. 2
      src/components/GenerateRoadmap/GenerateRoadmap.tsx
  2. 19
      src/components/GenerateRoadmap/RoadmapTopicDetail.tsx

@ -367,7 +367,7 @@ export function GenerateRoadmap() {
limitUsed={roadmapLimitUsed} limitUsed={roadmapLimitUsed}
onLoadTopic={(topic: string) => { onLoadTopic={(topic: string) => {
setRoadmapTopic(topic); setRoadmapTopic(topic);
loadTopic(topic); loadTopic(topic).finally(() => {});
}} }}
/> />
); );

@ -40,12 +40,12 @@ export function RoadmapTopicDetail(props: RoadmapTopicDetailProps) {
const generateAiRoadmapTopicContent = async () => { const generateAiRoadmapTopicContent = async () => {
setIsLoading(true); setIsLoading(true);
setError(''); setError('');
//
if (topicLimitUsed >= topicLimit) { // if (topicLimitUsed >= topicLimit) {
setError('You have reached the limit of topics'); // setError('Maximum limit reached');
setIsLoading(false); // setIsLoading(false);
return; // return;
} // }
if (!roadmapId || !nodeTitle) { if (!roadmapId || !nodeTitle) {
setIsLoading(false); setIsLoading(false);
@ -129,7 +129,7 @@ export function RoadmapTopicDetail(props: RoadmapTopicDetailProps) {
tabIndex={0} tabIndex={0}
className="fixed right-0 top-0 z-40 h-screen w-full overflow-y-auto bg-white p-4 focus:outline-0 sm:max-w-[600px] sm:p-6" className="fixed right-0 top-0 z-40 h-screen w-full overflow-y-auto bg-white p-4 focus:outline-0 sm:max-w-[600px] sm:p-6"
> >
<div className="flex flex-col items-start gap-2"> <div className="flex flex-col sm:flex-row items-start gap-2">
<span> <span>
<span <span
className={cn( className={cn(
@ -142,7 +142,7 @@ export function RoadmapTopicDetail(props: RoadmapTopicDetailProps) {
> >
{topicLimitUsed} of {topicLimit} {topicLimitUsed} of {topicLimit}
</span>{' '} </span>{' '}
topic content generated. topics generated
</span> </span>
{!isLoggedIn() && ( {!isLoggedIn() && (
<button <button
@ -150,8 +150,7 @@ export function RoadmapTopicDetail(props: RoadmapTopicDetailProps) {
onClick={showLoginPopup} onClick={showLoginPopup}
> >
Generate more by{' '} Generate more by{' '}
<span className="font-semibold">signing up (free, takes 2s)</span>{' '} <span className="font-semibold">logging in</span>
or <span className="font-semibold">logging in</span>
</button> </button>
)} )}
</div> </div>

Loading…
Cancel
Save