Skip to content

Commit

Permalink
Change state variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
escapemanuele committed Jan 17, 2025
1 parent e0011b6 commit e6e8c2b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ export const MessagesContainer = ( { currentUser }: ChatMessagesProps ) => {
const [ searchParams ] = useSearchParams();
const isForwardingToZendesk =
searchParams.get( 'provider' ) === 'zendesk' && chat.provider !== 'zendesk';
const [ chatMessagesLoaded, setChatLoaded ] = useState( false );
const [ chatMessagesLoaded, setChatMessagesLoaded ] = useState( false );
const messagesContainerRef = useRef< HTMLDivElement >( null );
useZendeskMessageListener();
useAutoScroll( messagesContainerRef );

useEffect( () => {
( chat?.status === 'loaded' || chat?.status === 'closed' ) &&
setChatLoaded( ! isForwardingToZendesk );
setChatMessagesLoaded( ! isForwardingToZendesk );
}, [ chat, isForwardingToZendesk ] );

/**
Expand All @@ -74,7 +74,7 @@ export const MessagesContainer = ( { currentUser }: ChatMessagesProps ) => {
resetSupportInteraction().then( () => {
if ( isChatLoaded ) {
createZendeskConversation().then( () => {
setChatLoaded( true );
setChatMessagesLoaded( true );
} );
}
} );
Expand Down

0 comments on commit e6e8c2b

Please sign in to comment.