79b3b6408e
See [#5580][0]. [0]: https://github.com/signalapp/Signal-Desktop/pull/5580
14 lines
430 B
TypeScript
14 lines
430 B
TypeScript
// Copyright 2021 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
export async function requestMicrophonePermissions(): Promise<boolean> {
|
|
const microphonePermission = await window.getMediaPermissions();
|
|
if (!microphonePermission) {
|
|
await window.showCallingPermissionsPopup(false);
|
|
|
|
// Check the setting again (from the source of truth).
|
|
return window.getMediaPermissions();
|
|
}
|
|
|
|
return true;
|
|
}
|