(fix): joining a call while already being in a call wouldn't reset the call state

(qol): format
This commit is contained in:
Alois 2026-04-30 23:37:26 +02:00
commit 4dbf48b3f9
8 changed files with 85 additions and 50 deletions

View file

@ -15,7 +15,10 @@ export default function View() {
(state) => state.activeScreenShareParticipantIds,
);
const containerRef = useRef<HTMLDivElement | null>(null);
const [focusedTileSize, setFocusedTileSize] = useState({ width: 0, height: 0 });
const [focusedTileSize, setFocusedTileSize] = useState({
width: 0,
height: 0,
});
const [isFocusedTileFlush, setIsFocusedTileFlush] = useState(false);
const [participantVersion, setParticipantVersion] = useState(0);
@ -42,7 +45,7 @@ export default function View() {
const participantId = Number(participant.identity);
return Number.isInteger(participantId) && participantId > 0;
});
// eslint-disable-next-line
// eslint-disable-next-line
}, [participantVersion, room]);
const userIds = useMemo(
@ -141,7 +144,10 @@ export default function View() {
activeScreenShareParticipantIdSet.has(focusedParticipantId);
return (
<div ref={containerRef} className="flex h-full w-full items-center justify-center overflow-hidden">
<div
ref={containerRef}
className="flex h-full w-full items-center justify-center overflow-hidden"
>
<div
className="flex max-h-full w-full flex-col items-center overflow-hidden"
style={{ gap: tiles.length > 0 ? STACK_GAP_PX : 0 }}

View file

@ -129,13 +129,16 @@ export default function View() {
}, [room]);
const users = useMemo(() => {
const participants = [...room.remoteParticipants.values(), room.localParticipant];
const participants = [
...room.remoteParticipants.values(),
room.localParticipant,
];
return participants.filter((participant) => {
const participantId = Number(participant.identity);
return Number.isInteger(participantId) && participantId > 0;
});
// eslint-disable-next-line
// eslint-disable-next-line
}, [participantVersion, room]);
const userIds = useMemo(
@ -195,9 +198,13 @@ export default function View() {
}
return (
<div ref={containerRef} style={{
height: "calc(100% - 2rem)"
}} className="w-full overflow-hidden p-3">
<div
ref={containerRef}
style={{
height: "calc(100% - 2rem)",
}}
className="w-full overflow-hidden p-3"
>
<div className="flex h-full w-full flex-col items-center justify-center gap-3">
{rows.map((row) => (
<div key={row.rowIndex} className="flex justify-center gap-3">
@ -217,7 +224,10 @@ export default function View() {
height: layout.tileHeight,
}}
>
<Base type={tile.kind} participant={getParticipantById(tile.participantId)} />
<Base
type={tile.kind}
participant={getParticipantById(tile.participantId)}
/>
</div>
);
})}