Don't unnecessarily use useEffect

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2023-07-06 12:12:28 +02:00
parent c8bf869367
commit 3d57d63f7f
No known key found for this signature in database
GPG key ID: D1D45825D60C24D2

View file

@ -219,14 +219,7 @@ export function GroupCallView({
undefined undefined
); );
const [livekitServiceURL, setLivekitServiceURL] = useState< const livekitServiceURL = groupCall.foci[0]?.livekitServiceUrl;
string | undefined
>(groupCall.foci[0]?.livekitServiceUrl);
useEffect(() => {
setLivekitServiceURL(groupCall.foci[0]?.livekitServiceUrl);
}, [setLivekitServiceURL, groupCall]);
if (!livekitServiceURL) { if (!livekitServiceURL) {
return <ErrorView error={new Error("No livekit_service_url defined")} />; return <ErrorView error={new Error("No livekit_service_url defined")} />;
} }