File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
examples/react-chatbot/components/AIChatApp Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -117,18 +117,15 @@ export const AIChatApp = ({
117117
118118 // Handle fade-out when both conditions are met
119119 useEffect ( ( ) => {
120- if ( chatClient && minTimeElapsed && ! isFadingOut ) {
121- // Start fade-out animation
122- setIsFadingOut ( true ) ;
123-
124- // Remove loading screen after animation completes (400ms)
125- const fadeOutTimer = setTimeout ( ( ) => {
126- setShowLoadingScreen ( false ) ;
127- } , 400 ) ;
128-
129- return ( ) => clearTimeout ( fadeOutTimer ) ;
130- }
131- } , [ chatClient , minTimeElapsed , isFadingOut ] ) ;
120+ if ( ! minTimeElapsed ) return ;
121+ setIsFadingOut ( true ) ;
122+ // Remove loading screen after animation completes (400ms)
123+ const fadeOutTimer = setTimeout ( ( ) => {
124+ setShowLoadingScreen ( false ) ;
125+ } , 400 ) ;
126+
127+ return ( ) => clearTimeout ( fadeOutTimer ) ;
128+ } , [ minTimeElapsed ] ) ;
132129
133130 return (
134131 < div className = "ai-demo-app" >
You can’t perform that action at this time.
0 commit comments