Remove clean room ID and add default handler for if no active call has existed yet, but user clicks on show chat

This commit is contained in:
Gigiaj
2025-05-21 21:12:51 -05:00
parent dabe7f7849
commit d9c0c85483

View File

@@ -54,10 +54,6 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro
const setupWidget = useCallback( const setupWidget = useCallback(
(widgetApiRef, smallWidgetRef, iframeRef, skipLobby) => { (widgetApiRef, smallWidgetRef, iframeRef, skipLobby) => {
const cleanupRoomId = smallWidgetRef.current?.roomId;
logger.error(`PersistentCallContainer effect running. activeCallRoomId: ${activeCallRoomId}`);
logger.error(`PersistentCallContainer effect running. viewedCallRoomId: ${viewedCallRoomId}`);
logger.error(`PersistentCallContainer effect running. isCallActive: ${isCallActive}`);
/** /**
* TODO: * TODO:
* Need proper shutdown handling. Events from the previous widget can still come through it seems. Might need * Need proper shutdown handling. Events from the previous widget can still come through it seems. Might need
@@ -84,12 +80,10 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro
if (mx?.getUserId()) { if (mx?.getUserId()) {
if ( if (
(activeCallRoomId !== viewedCallRoomId && isCallActive) || (activeCallRoomId !== viewedCallRoomId && isCallActive) ||
// && (activeCallRoomId && !isCallActive) ||
(activeCallRoomId && cleanupRoomId !== activeCallRoomId && !isCallActive) (!activeCallRoomId && viewedCallRoomId && !isCallActive)
) { ) {
logger.error('PersistentCallContainer Re-render');
const roomIdToSet = skipLobby ? activeCallRoomId : viewedCallRoomId; const roomIdToSet = skipLobby ? activeCallRoomId : viewedCallRoomId;
if ( if (
roomIdToSet && roomIdToSet &&
(roomIdToSet === primarySmallWidgetRef?.current?.roomId || (roomIdToSet === primarySmallWidgetRef?.current?.roomId ||