added access to camera check

pull/1814/head
Brice-W 4 years ago
parent 6ca2476f41
commit c415c715a5

@ -340,7 +340,7 @@
window.toggleMediaPermissions = async () => { window.toggleMediaPermissions = async () => {
const value = window.getMediaPermissions(); const value = window.getMediaPermissions();
if (value === false && Signal.OS.isMacOS()) { if (value === false && Signal.OS.isMacOS()) {
await window.askForMicrophoneAccess(); await window.askForMediaAccess();
} }
window.setMediaPermissions(!value); window.setMediaPermissions(!value);
}; };

@ -985,13 +985,19 @@ function getThemeFromMainWindow() {
}); });
} }
function askForMicrophoneAccess() { function askForMediaAccess() {
const status = systemPreferences.getMediaAccessStatus('microphone'); // Microphone part
let status = systemPreferences.getMediaAccessStatus('microphone');
if (status !== 'granted') { if (status !== 'granted') {
systemPreferences.askForMediaAccess('microphone'); systemPreferences.askForMediaAccess('microphone');
} }
// Camera part
status = systemPreferences.getMediaAccessStatus('camera');
if (status !== 'granted') {
systemPreferences.askForMediaAccess('camera');
}
} }
ipc.on('microphone-access', () => { ipc.on('media-access', () => {
askForMicrophoneAccess(); askForMediaAccess();
}); });

@ -219,7 +219,7 @@ window.setSettingValue = (settingID, value) => {
window.getMediaPermissions = () => ipc.sendSync('get-media-permissions'); window.getMediaPermissions = () => ipc.sendSync('get-media-permissions');
window.setMediaPermissions = value => ipc.send('set-media-permissions', !!value); window.setMediaPermissions = value => ipc.send('set-media-permissions', !!value);
window.askForMicrophoneAccess = () => ipc.send('microphone-access'); window.askForMediaAccess = () => ipc.send('media-access');
// Auto update setting // Auto update setting
window.getAutoUpdateEnabled = () => ipc.sendSync('get-auto-update-setting'); window.getAutoUpdateEnabled = () => ipc.sendSync('get-auto-update-setting');

Loading…
Cancel
Save