Skip to content

Commit

Permalink
Don't trigger macOS' permission check on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
SRichner committed Mar 6, 2024
1 parent cec89e6 commit dc8c202
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/electron/electron/ipc/IpcHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { DataExportService } from '../main/services/DataExportService';
import UserInputDto from '../../shared/dto/UserInputDto';
import WindowActivityDto from '../../shared/dto/WindowActivityDto';
import ExperienceSamplingDto from '../../shared/dto/ExperienceSamplingDto';
import { is } from '../main/services/utils/helpers';

const LOG = getLogger('IpcHandler');

Expand Down Expand Up @@ -154,10 +155,16 @@ export class IpcHandler {
}

private triggerPermissionCheckAccessibility(prompt: boolean): boolean {
if (is.windows) {
return true;
}
return systemPreferences.isTrustedAccessibilityClient(prompt);
}

private triggerPermissionCheckScreenRecording(): boolean {
if (is.windows) {
return true;
}
const status = systemPreferences.getMediaAccessStatus('screen');
return status === 'granted';
}
Expand Down
4 changes: 3 additions & 1 deletion src/electron/electron/main/services/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import electron from 'electron';
export declare interface Is {
dev: boolean;
macOS: boolean;
windows: boolean;
}

export const is: Is = {
dev: !electron.app.isPackaged,
macOS: process.platform === 'darwin'
macOS: process.platform === 'darwin',
windows: process.platform === 'win32'
};

export function generateAlphaNumericString(length: number = 0): string {
Expand Down

0 comments on commit dc8c202

Please sign in to comment.