File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
package/src/components/Chat/hooks Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,12 @@ export const useCreateChatClient = ({
3232 optionsRef . current = options ;
3333
3434 useEffect ( ( ) => {
35+ const userData = userDataRef . current ;
36+
3537 const client = new StreamChat ( apiKey , undefined , optionsRef . current ) ;
3638 let didUserConnectInterrupt = false ;
3739
38- const connectionPromise = client . connectUser ( userDataRef . current , tokenOrProvider ) . then ( ( ) => {
40+ const connectionPromise = client . connectUser ( userData , tokenOrProvider ) . then ( ( ) => {
3941 if ( ! didUserConnectInterrupt ) {
4042 setChatClient ( client ) ;
4143 }
@@ -47,7 +49,7 @@ export const useCreateChatClient = ({
4749 connectionPromise
4850 . then ( ( ) => client . disconnectUser ( ) )
4951 . then ( ( ) => {
50- console . log ( `Connection for user "${ userDataRef . current . id } " has been closed` ) ;
52+ console . log ( `Connection for user "${ userData . id } " has been closed` ) ;
5153 } ) ;
5254 } ;
5355 // we should recompute the client on user id change
You can’t perform that action at this time.
0 commit comments