mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
fix(electron): use askForMeetingPermission for asking microphone permission (#11792)
This commit is contained in:
@@ -780,6 +780,13 @@ export const checkMeetingPermissions = () => {
|
||||
) as Record<(typeof mediaTypes)[number], boolean>;
|
||||
};
|
||||
|
||||
export const askForMeetingPermission = async (type: 'microphone') => {
|
||||
if (!isMacOS()) {
|
||||
return false;
|
||||
}
|
||||
return systemPreferences.askForMediaAccess(type);
|
||||
};
|
||||
|
||||
export const checkCanRecordMeeting = () => {
|
||||
const features = checkMeetingPermissions();
|
||||
return (
|
||||
|
||||
@@ -9,6 +9,7 @@ import { shell } from 'electron';
|
||||
import { isMacOS } from '../../shared/utils';
|
||||
import type { NamespaceHandlers } from '../type';
|
||||
import {
|
||||
askForMeetingPermission,
|
||||
checkMeetingPermissions,
|
||||
checkRecordingAvailable,
|
||||
disableRecordingFeature,
|
||||
@@ -76,6 +77,9 @@ export const recordingHandlers = {
|
||||
checkMeetingPermissions: async () => {
|
||||
return checkMeetingPermissions();
|
||||
},
|
||||
askForMeetingPermission: async (_, type: 'microphone') => {
|
||||
return askForMeetingPermission(type);
|
||||
},
|
||||
showRecordingPermissionSetting: async (_, type: 'screen' | 'microphone') => {
|
||||
const urlMap = {
|
||||
screen: 'Privacy_ScreenCapture',
|
||||
|
||||
Reference in New Issue
Block a user