Skip to content

Commit

Permalink
Fix: aspect ratio ignored due to type (#3333)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 authored Oct 22, 2024
1 parent 9716660 commit 22b142b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const useLocalTileAspectRatio = () => {
} else {
aspectRatio = isMobile ? 9 / 16 : 16 / 9;
}
return aspectRatio;
return aspectRatio.toString();
};

const PreviewJoin = ({
Expand Down Expand Up @@ -113,6 +113,7 @@ const PreviewJoin = ({
const { elements = {} } = useRoomLayoutPreviewScreen();
const { preview_header: previewHeader = {}, virtual_background } = elements || {};
const aspectRatio = useLocalTileAspectRatio();

useEffect(() => {
if (authToken) {
if (skipPreview) {
Expand Down Expand Up @@ -158,7 +159,7 @@ const PreviewJoin = ({
</Flex>
</Flex>
{toggleVideo ? <PreviewTile name={name} error={previewError} /> : null}
<Box css={{ w: '100%', maxWidth: `${Math.max(aspectRatio, 1) * 340}px` }}>
<Box css={{ w: '100%', maxWidth: `${Math.max(parseFloat(aspectRatio), 1) * 340}px` }}>
<PreviewControls hideSettings={!toggleVideo && !toggleAudio} vbEnabled={!!virtual_background} />
<PreviewForm
name={name}
Expand Down

0 comments on commit 22b142b

Please sign in to comment.