mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-11 01:30: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 { 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();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue