forked from github/cinny
revert ternary expression change and add to dependency array
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable no-nested-ternary */
|
||||||
import { Room } from 'matrix-js-sdk';
|
import { Room } from 'matrix-js-sdk';
|
||||||
import React, { useContext, useMemo } from 'react';
|
import React, { useContext, useMemo } from 'react';
|
||||||
import { useCallback, useEffect, useRef } 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 screenSize = useScreenSizeContext();
|
||||||
const isMobile = screenSize === ScreenSize.Mobile;
|
const isMobile = screenSize === ScreenSize.Mobile;
|
||||||
|
const activeIframeDisplayRef = isPrimaryIframe
|
||||||
const activeIframeDisplayRef =
|
? isViewingActiveCall
|
||||||
isViewingActiveCall && isPrimaryIframe ? primaryIframeRef : backupIframeRef;
|
? primaryIframeRef
|
||||||
|
: backupIframeRef
|
||||||
|
: isViewingActiveCall
|
||||||
|
? backupIframeRef
|
||||||
|
: primaryIframeRef;
|
||||||
|
|
||||||
const applyFixedPositioningToIframe = useCallback(() => {
|
const applyFixedPositioningToIframe = useCallback(() => {
|
||||||
const iframeElement = activeIframeDisplayRef?.current;
|
const iframeElement = activeIframeDisplayRef?.current;
|
||||||
@@ -120,13 +125,7 @@ export function CallView({ room, eventId }: { room: Room; eventId?: string }) {
|
|||||||
originalIframeStylesRef.current = null;
|
originalIframeStylesRef.current = null;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}, [
|
}, [activeIframeDisplayRef, applyFixedPositioningToIframe, debouncedApplyFixedPositioning, isPrimaryIframe, isViewingActiveCall, room]);
|
||||||
activeIframeDisplayRef,
|
|
||||||
applyFixedPositioningToIframe,
|
|
||||||
debouncedApplyFixedPositioning,
|
|
||||||
isPrimaryIframe,
|
|
||||||
isViewingActiveCall,
|
|
||||||
]);
|
|
||||||
|
|
||||||
const isCallViewVisible = room.isCallRoom();
|
const isCallViewVisible = room.isCallRoom();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user