Signal-Desktop/ts/util/callingPermissions.ts

14 lines
385 B
TypeScript
Raw Normal View History

2020-10-30 20:34:04 +00:00
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
2020-06-04 18:16:19 +00:00
export async function requestCameraPermissions(): Promise<boolean> {
if (!(await window.getMediaCameraPermissions())) {
2021-11-05 08:47:32 +00:00
await window.showPermissionsPopup(true, true);
2020-06-04 18:16:19 +00:00
// Check the setting again (from the source of truth).
return window.getMediaCameraPermissions();
}
return true;
}