forked from github/cinny
Fix the view to correctly display the active iframe based on which is currently hosting the active call (juggling views)
This commit is contained in:
@@ -50,7 +50,8 @@ export function CallView({ room, eventId }: { room: Room; eventId?: string }) {
|
|||||||
const screenSize = useScreenSizeContext();
|
const screenSize = useScreenSizeContext();
|
||||||
const isMobile = screenSize === ScreenSize.Mobile;
|
const isMobile = screenSize === ScreenSize.Mobile;
|
||||||
|
|
||||||
const activeIframeDisplayRef = isPrimaryIframe ? primaryIframeRef : backupIframeRef;
|
const activeIframeDisplayRef =
|
||||||
|
isViewingActiveCall && isPrimaryIframe ? primaryIframeRef : backupIframeRef;
|
||||||
|
|
||||||
const applyFixedPositioningToIframe = useCallback(() => {
|
const applyFixedPositioningToIframe = useCallback(() => {
|
||||||
const iframeElement = activeIframeDisplayRef?.current;
|
const iframeElement = activeIframeDisplayRef?.current;
|
||||||
@@ -97,7 +98,7 @@ export function CallView({ room, eventId }: { room: Room; eventId?: string }) {
|
|||||||
const iframeElement = activeIframeDisplayRef?.current;
|
const iframeElement = activeIframeDisplayRef?.current;
|
||||||
const hostElement = iframeHostRef?.current;
|
const hostElement = iframeHostRef?.current;
|
||||||
|
|
||||||
if (!isPrimaryIframe || (isViewingActiveCall && iframeElement && hostElement)) {
|
if (room.isCallRoom() || (isViewingActiveCall && iframeElement && hostElement)) {
|
||||||
applyFixedPositioningToIframe();
|
applyFixedPositioningToIframe();
|
||||||
|
|
||||||
const resizeObserver = new ResizeObserver(debouncedApplyFixedPositioning);
|
const resizeObserver = new ResizeObserver(debouncedApplyFixedPositioning);
|
||||||
|
|||||||
Reference in New Issue
Block a user