Skip to content

Commit

Permalink
(#72) πŸš€ feat: 챗봇 νŽ˜μ΄μ§€ 처음 μ ‘μ†μ‹œμ—λŠ” 전체 μœˆλ„μš° μžλ™ 슀크둀 ν˜„μƒ 막기
Browse files Browse the repository at this point in the history
  • Loading branch information
inaemon committed Nov 27, 2024
1 parent 88a9c57 commit c6370d9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/Chatbot/Chatbot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ const Chatbot = () => {
const [selectedStadium, setSelectedStadium] = useState<string | null>(null); // μ„ νƒν•œ μŠ€νƒ€λ””μ›€ μ €μž₯
const isStadiumSelected = selectedStadium !== null && selectedStadium !== ""; // μŠ€νƒ€λ””μ›€ 선택 μ—¬λΆ€
const [showInitialMessages, setShowInitialMessages] = useState(false); // 초기 λ©”μ‹œμ§€ 좜λ ₯ μ—¬λΆ€
const [isLoading, setIsLoading] = useState(true); // λ‘œλ”© μƒνƒœ μΆ”κ°€ // μ΄ˆκΈ°μ—λŠ” μžλ™ 슀크둀 μ‹€ν–‰λ˜μ§€ μ•Šλ„λ‘ ν•˜κΈ° μœ„ν•¨

const handleStadiumSelect = (stadium: string) => {
setSelectedStadium(stadium);
setIsLoading(false); // λ‘œλ”©μ΄ λλ‚˜λ©΄ isLoading을 false둜 μ„€μ •
};


Expand Down Expand Up @@ -100,7 +102,7 @@ const Chatbot = () => {
);
}


// μŠ€ν¬λ‘€μ„ μ‘°μž‘ν•  μ˜μ—­(μ±„νŒ…μ°½ div) 지정
const chatContainerRef = useRef<HTMLDivElement>(null);

Expand All @@ -119,7 +121,9 @@ const Chatbot = () => {
}
};
useEffect(() => {
scrollToBottom();
if (!isLoading) {
scrollToBottom();
}
}, [selectedStadium, selectedCategories, responseGuideDataList]);


Expand Down

0 comments on commit c6370d9

Please sign in to comment.