signal-desktop/ts/util/requestMicrophonePermissions.ts
Scott Nonnenberg fe9d042e40
Introduce the new Settings tab
Co-authored-by: Jamie Kyle <jamie@signal.org>
Co-authored-by: Fedor Indutny <indutny@signal.org>
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
2025-05-14 20:58:20 -07:00

16 lines
473 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export async function requestMicrophonePermissions(
forCalling: boolean
): Promise<boolean> {
const microphonePermission = await window.IPC.getMediaPermissions();
if (!microphonePermission) {
await window.IPC.showPermissionsPopup(forCalling, false);
// Check the setting again (from the source of truth).
return window.Events.getMediaPermissions();
}
return true;
}