How to reset connection?

Hi Tommy,

infact that is what I’m currently doing. I have state with my topic setup and I have useEffect where I’m checking it:

const session = client?.getSessionInfo();    
if (!roomSetup && session?.isInMeeting) {
      client.leave()
        .then(() => console.log('Leaved session succesfully'))
        .catch((e) => console.error('leave session errored', e));
}

I’m still getting 4 error messages:
WebSocket is already in CLOSING or CLOSED state.

This promise is resolved successfully but there is no ‘connection-change’ event received.

When I’m trying to join new meeting by calling client.join(). This promise is rejected with ‘duplicated operation’ error. So it seems like connection is not closed correctly and is left in some error state. This could be related to Calling client.leave() to end session is not triggering the client connection-change event. Is there something else that I should do after client.leave() before I’m joining again?