mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-10 09:10:29 +03:00
revert ternary expression change and add to dependency array
This commit is contained in:
parent
5481595a67
commit
c6ceb3f977
1 changed files with 9 additions and 10 deletions
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable no-nested-ternary */
|
||||
import { Room } from 'matrix-js-sdk';
|
||||
import React, { useContext, useMemo } from 'react';
|
||||
import { useCallback, useEffect, useRef } from 'react';
|
||||
|
|
@ -49,9 +50,13 @@ export function CallView({ room, eventId }: { room: Room; eventId?: string }) {
|
|||
|
||||
const screenSize = useScreenSizeContext();
|
||||
const isMobile = screenSize === ScreenSize.Mobile;
|
||||
|
||||
const activeIframeDisplayRef =
|
||||
isViewingActiveCall && isPrimaryIframe ? primaryIframeRef : backupIframeRef;
|
||||
const activeIframeDisplayRef = isPrimaryIframe
|
||||
? isViewingActiveCall
|
||||
? primaryIframeRef
|
||||
: backupIframeRef
|
||||
: isViewingActiveCall
|
||||
? backupIframeRef
|
||||
: primaryIframeRef;
|
||||
|
||||
const applyFixedPositioningToIframe = useCallback(() => {
|
||||
const iframeElement = activeIframeDisplayRef?.current;
|
||||
|
|
@ -120,13 +125,7 @@ export function CallView({ room, eventId }: { room: Room; eventId?: string }) {
|
|||
originalIframeStylesRef.current = null;
|
||||
};
|
||||
}
|
||||
}, [
|
||||
activeIframeDisplayRef,
|
||||
applyFixedPositioningToIframe,
|
||||
debouncedApplyFixedPositioning,
|
||||
isPrimaryIframe,
|
||||
isViewingActiveCall,
|
||||
]);
|
||||
}, [activeIframeDisplayRef, applyFixedPositioningToIframe, debouncedApplyFixedPositioning, isPrimaryIframe, isViewingActiveCall, room]);
|
||||
|
||||
const isCallViewVisible = room.isCallRoom();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue