added access to camera check
This commit is contained in:
parent
6ca2476f41
commit
c415c715a5
|
@ -340,7 +340,7 @@
|
|||
window.toggleMediaPermissions = async () => {
|
||||
const value = window.getMediaPermissions();
|
||||
if (value === false && Signal.OS.isMacOS()) {
|
||||
await window.askForMicrophoneAccess();
|
||||
await window.askForMediaAccess();
|
||||
}
|
||||
window.setMediaPermissions(!value);
|
||||
};
|
||||
|
|
14
main.js
14
main.js
|
@ -985,13 +985,19 @@ function getThemeFromMainWindow() {
|
|||
});
|
||||
}
|
||||
|
||||
function askForMicrophoneAccess() {
|
||||
const status = systemPreferences.getMediaAccessStatus('microphone');
|
||||
function askForMediaAccess() {
|
||||
// Microphone part
|
||||
let status = systemPreferences.getMediaAccessStatus('microphone');
|
||||
if (status !== 'granted') {
|
||||
systemPreferences.askForMediaAccess('microphone');
|
||||
}
|
||||
// Camera part
|
||||
status = systemPreferences.getMediaAccessStatus('camera');
|
||||
if (status !== 'granted') {
|
||||
systemPreferences.askForMediaAccess('camera');
|
||||
}
|
||||
}
|
||||
|
||||
ipc.on('microphone-access', () => {
|
||||
askForMicrophoneAccess();
|
||||
ipc.on('media-access', () => {
|
||||
askForMediaAccess();
|
||||
});
|
||||
|
|
|
@ -219,7 +219,7 @@ window.setSettingValue = (settingID, value) => {
|
|||
window.getMediaPermissions = () => ipc.sendSync('get-media-permissions');
|
||||
window.setMediaPermissions = value => ipc.send('set-media-permissions', !!value);
|
||||
|
||||
window.askForMicrophoneAccess = () => ipc.send('microphone-access');
|
||||
window.askForMediaAccess = () => ipc.send('media-access');
|
||||
|
||||
// Auto update setting
|
||||
window.getAutoUpdateEnabled = () => ipc.sendSync('get-auto-update-setting');
|
||||
|
|
Loading…
Reference in New Issue