Fallback to config LiveKit URL if there is no URL coming from the js-sdk

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2023-07-07 16:08:30 +02:00
parent e194d56894
commit 124c6223e4
No known key found for this signature in database
GPG key ID: D1D45825D60C24D2

View file

@ -36,6 +36,7 @@ import { UserChoices } from "../livekit/useLiveKit";
import { findDeviceByName } from "../media-utils";
import { OpenIDLoader } from "../livekit/OpenIDLoader";
import { ActiveCall } from "./InCallView";
import { Config } from "../config/Config";
declare global {
interface Window {
@ -219,7 +220,9 @@ export function GroupCallView({
undefined
);
const livekitServiceURL = groupCall.foci[0]?.livekitServiceUrl;
const livekitServiceURL =
groupCall.foci[0]?.livekitServiceUrl ??
Config.get().livekit.livekit_service_url;
if (!livekitServiceURL) {
return <ErrorView error={new Error("No livekit_service_url defined")} />;
}