(fix): call being getting initialised even on the login screen
This commit is contained in:
parent
9e3a6040e3
commit
a0e3e85467
6 changed files with 73 additions and 55 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { Lock, LockOpen } from "lucide-react";
|
||||
import { openCallPage, useCall } from "../store";
|
||||
import { openCallPage, useCall, getRoom } from "../store";
|
||||
import {
|
||||
Button,
|
||||
Card,
|
||||
|
|
@ -78,7 +78,7 @@ function ConnectionBar() {
|
|||
}
|
||||
|
||||
export function TinyPingGraph() {
|
||||
const room = useCall((store) => store.room);
|
||||
const room = getRoom();
|
||||
|
||||
const [mapData, setMapData] = useState<Map<number, number>>(() => new Map());
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useUser, type User } from "@tensamin/user/context";
|
||||
import { useCall } from "../store";
|
||||
import { useCall, getRoom } from "../store";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useStorage } from "@tensamin/storage/context";
|
||||
import {
|
||||
|
|
@ -14,7 +14,7 @@ import {
|
|||
export default function TopBar() {
|
||||
const { get } = useUser();
|
||||
const { load } = useStorage();
|
||||
const room = useCall((state) => state.room);
|
||||
const room = getRoom();
|
||||
const screenRef = useCall((state) => state.screenRef);
|
||||
const [portalContainer, setPortalContainer] = useState<HTMLElement>();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { VideoTrack, useParticipantTracks } from "@livekit/components-react";
|
||||
import { TrackPublication } from "livekit-client";
|
||||
import { useCall } from "../store";
|
||||
import { getRoom } from "../store";
|
||||
import { cn } from "@tensamin/ui";
|
||||
import { Loader2 } from "lucide-react";
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ export default function VideoViewer({
|
|||
publication: TrackPublication;
|
||||
participantId: string;
|
||||
}) {
|
||||
const room = useCall((state) => state.room);
|
||||
const room = getRoom();
|
||||
const tracks = useParticipantTracks([publication.source], {
|
||||
participantIdentity: participantId,
|
||||
room,
|
||||
|
|
|
|||
Loading…
Reference in a new issue