Skip to content

Commit

Permalink
refactor: merge category result after parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Feb 11, 2025
1 parent a63240a commit 8d6ab5c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/components/survey/SurveyAIBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
import { Checkbox } from '../ui/checkbox';
import { useWatch } from '@/hooks/useWatch';
import { Alert, AlertDescription, AlertTitle } from '../ui/alert';
import { uniq } from 'lodash-es';

interface SurveyAIBtnProps {
surveyId: string;
Expand Down Expand Up @@ -92,7 +93,7 @@ export const SurveyAIBtn: React.FC<SurveyAIBtnProps> = React.memo((props) => {
suggestionCategory: category,
});

setCategory(categorys);
setCategory((state) => uniq([...state, ...categorys]));

setResultText([
t('Analysis Count: {{num}}', { num: analysisCount }),
Expand Down

0 comments on commit 8d6ab5c

Please sign in to comment.