Files
Desktop/ts/util/requestMicrophonePermissions.dom.ts
Fedor Indutny 44076ece79 Rename files
2025-10-16 23:45:44 -07:00

17 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;
}