Skip to content

Commit 8da7268

Browse files
committed
refactor: LowerTodo AI 에러 처리에 AiFailModal 적용
1 parent 0109064 commit 8da7268

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/page/todo/lowerTodo/hook/useLowerTodoAI.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ALERT, GOAL_COUNT } from '../constants';
44
import { extractTitles, formatAiRecommendTitles } from '../utils/goal';
55

66
import AiRecommendModal from '@/common/component/AiRecommendModal/AiRecommendModal';
7+
import AiFailModal from '@/common/component/AiFailModal/AiFailModal';
78
import { useOverlayModal } from '@/common/hook/useOverlayModal';
89
import { usePostAiRecommendNewSubGoal } from '@/api/domain/lowerTodo/hook';
910

@@ -152,7 +153,8 @@ export const useLowerTodoAI = ({
152153
openModal(aiModalContent);
153154
} catch (error) {
154155
const message = getServerMessage(error, ALERT.aiFetchFail);
155-
alert(message);
156+
const failModalContent = <AiFailModal onClose={closeModal} message={message} />;
157+
openModal(failModalContent);
156158
} finally {
157159
updateAiUsed();
158160
}

0 commit comments

Comments
 (0)