fix(web): mic-loss recovery uses 'could not be restored' for unclassified errors
This commit is contained in:
@@ -433,7 +433,7 @@ export function useLiveKit() {
|
|||||||
if (roomRef.current !== subscriberRoom || !subscriberRoom) return;
|
if (roomRef.current !== subscriberRoom || !subscriberRoom) return;
|
||||||
|
|
||||||
const deviceId = useVoiceStore.getState().inputDeviceId;
|
const deviceId = useVoiceStore.getState().inputDeviceId;
|
||||||
let copy = 'Microphone unavailable';
|
let copy = 'Microphone could not be restored';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const probe = await navigator.mediaDevices.getUserMedia({
|
const probe = await navigator.mediaDevices.getUserMedia({
|
||||||
@@ -449,7 +449,7 @@ export function useLiveKit() {
|
|||||||
await republishMicrophone(subscriberRoom, lastMicGenRef);
|
await republishMicrophone(subscriberRoom, lastMicGenRef);
|
||||||
return;
|
return;
|
||||||
} catch {
|
} catch {
|
||||||
copy = 'Microphone could not be restored';
|
// copy already holds 'Microphone could not be restored'
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err?.name === 'NotAllowedError') {
|
if (err?.name === 'NotAllowedError') {
|
||||||
@@ -464,6 +464,8 @@ export function useLiveKit() {
|
|||||||
} else {
|
} else {
|
||||||
copy = 'Microphone disconnected';
|
copy = 'Microphone disconnected';
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
copy = 'Microphone could not be restored';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user