Enable strict lints

An attempt to fix https://github.com/vector-im/element-call/issues/1132
This commit is contained in:
Daniel Abramov
2023-06-30 16:43:28 +01:00
parent d86d3de95e
commit 0105162ffa
68 changed files with 970 additions and 724 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,