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(
(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:
* 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 (
(activeCallRoomId !== viewedCallRoomId && isCallActive) ||
// &&
(activeCallRoomId && cleanupRoomId !== activeCallRoomId && !isCallActive)
(activeCallRoomId && !isCallActive) ||
(!activeCallRoomId && viewedCallRoomId && !isCallActive)
) {
logger.error('PersistentCallContainer Re-render');
const roomIdToSet = skipLobby ? activeCallRoomId : viewedCallRoomId;
if (
roomIdToSet &&
(roomIdToSet === primarySmallWidgetRef?.current?.roomId ||