signal-desktop/ts/util/callingPermissions.ts

14 lines
397 B
TypeScript
Raw Normal View History

2020-10-30 15:34:04 -05:00
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
2020-06-04 11:16:19 -07:00
export async function requestCameraPermissions(): Promise<boolean> {
2023-01-12 19:24:59 -05:00
if (!(await window.IPC.getMediaCameraPermissions())) {
await window.IPC.showPermissionsPopup(true, true);
2020-06-04 11:16:19 -07:00
// Check the setting again (from the source of truth).
2023-01-12 19:24:59 -05:00
return window.IPC.getMediaCameraPermissions();
2020-06-04 11:16:19 -07:00
}
return true;
}