Skip to content

Commit f225694

Browse files
committed
fix the reenter issue
1 parent 4e3a704 commit f225694

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/components/TopicRefiner.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ export const TopicRefiner: FC<Omit<TopicRefinerProps, 'isLlmProcessing'>> = ({
7272
useEffect(() => {
7373
// Disable scroll on mount
7474
document.body.style.overflow = "hidden";
75+
// Clear AI suggestions when component mounts
76+
setLlmSuggestions([]);
7577
return () => {
7678
// Restore scroll on unmount
7779
document.body.style.overflow = "";
7880
};
79-
}, []);
81+
}, []); // Empty dependency array means this runs once on mount
8082

8183
const handleGetSuggestions = async () => {
8284
if (!apiKey) {
@@ -180,6 +182,9 @@ export const TopicRefiner: FC<Omit<TopicRefinerProps, 'isLlmProcessing'>> = ({
180182
<h3 className="h5 mb-0 d-flex align-items-center">
181183
<Sparkles className="text-warning me-2" size={20} />
182184
Available Topics
185+
<span className="badge bg-secondary ms-2" style={{ fontSize: '0.9rem' }}>
186+
{selectedTopics.length} topics
187+
</span>
183188
</h3>
184189
<div className="d-flex gap-2">
185190
<button
@@ -238,6 +243,9 @@ export const TopicRefiner: FC<Omit<TopicRefinerProps, 'isLlmProcessing'>> = ({
238243
<h3 className="h5 mb-4 d-flex align-items-center">
239244
<Edit size={20} className="text-primary me-2" />
240245
Finalized Topics
246+
<span className="badge bg-secondary ms-2" style={{ fontSize: '0.9rem' }}>
247+
{finalizedTopics.length} topics
248+
</span>
241249
</h3>
242250
<div className="mb-4">
243251
<div className="input-group">

0 commit comments

Comments
 (0)