Merge pull request #1173 from vector-im/lint-fixes

Enable stricter lints
This commit is contained in:
Daniel Abramov
2023-07-12 17:18:33 +02:00
committed by GitHub
72 changed files with 1091 additions and 810 deletions

View File

@@ -37,7 +37,7 @@ interface Props {
children: ReactNode;
}
const SFUConfigContext = createContext<SFUConfig>(undefined);
const SFUConfigContext = createContext<SFUConfig | undefined>(undefined);
export const useSFUConfig = () => useContext(SFUConfigContext);
@@ -62,7 +62,7 @@ export function OpenIDLoader({
setState({ kind: "loaded", sfuConfig: result });
} catch (e) {
logger.error("Failed to fetch SFU config: ", e);
setState({ kind: "failed", error: e });
setState({ kind: "failed", error: e as Error });
}
})();
}, [client, livekitServiceURL, roomName]);

View File

@@ -17,7 +17,7 @@ export type DeviceChoices = {
export function useLiveKit(
userChoices: UserChoices,
sfuConfig: SFUConfig
sfuConfig?: SFUConfig
): Room | undefined {
const roomOptions = useMemo((): RoomOptions => {
const options = defaultLiveKitOptions;
@@ -33,8 +33,8 @@ export function useLiveKit(
}, [userChoices.video, userChoices.audio]);
const { room } = useLiveKitRoom({
token: sfuConfig.jwt,
serverUrl: sfuConfig.url,
token: sfuConfig?.jwt,
serverUrl: sfuConfig?.url,
audio: userChoices.audio?.enabled ?? false,
video: userChoices.video?.enabled ?? false,
options: roomOptions,