mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 20:54:59 +08:00
Conform src/hooks/*
code to strictNullChecks
(#10460)
This commit is contained in:
parent
afb2cb93f2
commit
065e970325
@ -42,7 +42,9 @@ export const useAudioDeviceSelection = (
|
||||
if (shouldRequestPermissionsRef.current) {
|
||||
shouldRequestPermissionsRef.current = false;
|
||||
requestMediaPermissions(false).then((stream: MediaStream | undefined) => {
|
||||
MediaDeviceHandler.getDevices().then(({ audioinput }) => {
|
||||
MediaDeviceHandler.getDevices().then((devices) => {
|
||||
if (!devices) return;
|
||||
const { audioinput } = devices;
|
||||
MediaDeviceHandler.getDefaultDevice(audioinput);
|
||||
const deviceFromSettings = MediaDeviceHandler.getAudioInput();
|
||||
const device =
|
||||
|
@ -166,9 +166,10 @@ export const usePublicRoomDirectory = (): {
|
||||
}, [protocols]);
|
||||
|
||||
useEffect(() => {
|
||||
localStorage.setItem(LAST_SERVER_KEY, config?.roomServer);
|
||||
if (config?.instanceId) {
|
||||
localStorage.setItem(LAST_INSTANCE_KEY, config?.instanceId);
|
||||
if (!config) return;
|
||||
localStorage.setItem(LAST_SERVER_KEY, config.roomServer);
|
||||
if (config.instanceId) {
|
||||
localStorage.setItem(LAST_INSTANCE_KEY, config.instanceId);
|
||||
} else {
|
||||
localStorage.removeItem(LAST_INSTANCE_KEY);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user