Fix issue with media permissions on Linux (#3355)
This commit is contained in:
@@ -60,6 +60,7 @@ jest.mock('main/windows/mainWindow', () => ({
|
||||
|
||||
describe('main/PermissionsManager', () => {
|
||||
describe('setForServer', () => {
|
||||
if (process.platform !== 'linux') {
|
||||
it('should ask for media permission when is not granted but the user explicitly granted it', () => {
|
||||
systemPreferences.getMediaAccessStatus.mockReturnValue('denied');
|
||||
const permissionsManager = new PermissionsManager('anyfile.json');
|
||||
@@ -67,6 +68,7 @@ describe('main/PermissionsManager', () => {
|
||||
expect(systemPreferences.askForMediaAccess).toHaveBeenNthCalledWith(1, 'microphone');
|
||||
expect(systemPreferences.askForMediaAccess).toHaveBeenNthCalledWith(2, 'camera');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
describe('handlePermissionRequest', () => {
|
||||
|
@@ -95,7 +95,7 @@ export class PermissionsManager extends JsonFileManager<PermissionsByOrigin> {
|
||||
};
|
||||
|
||||
setForServer = (server: MattermostServer, permissions: Permissions) => {
|
||||
if (permissions.media?.allowed) {
|
||||
if (permissions.media?.allowed && (process.platform === 'win32' || process.platform === 'darwin')) {
|
||||
this.checkMediaAccess('microphone');
|
||||
this.checkMediaAccess('camera');
|
||||
}
|
||||
|
Reference in New Issue
Block a user