Skip to content

Commit

Permalink
Start trackers immediately on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
SRichner committed Feb 26, 2024
1 parent b696c83 commit 6d47323
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/electron/electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,21 @@ app.whenReady().then(async () => {

const settings: Settings = await Settings.findOneBy({ onlyOneEntityShouldExist: 1 });

if (settings.onboardingShown === false || !hasAccessibilityAndScreenRecordingPermission()) {
if (
settings.onboardingShown === false ||
!macOSHasAccessibilityAndScreenRecordingPermission()
) {
LOG.debug(
`Onboarding shown: ${settings.onboardingShown}, hasAccessibilityAndScreenRecordingPermission: ${hasAccessibilityAndScreenRecordingPermission()}, creating onboarding window...`
`Onboarding shown: ${settings.onboardingShown}, hasAccessibilityAndScreenRecordingPermission: ${macOSHasAccessibilityAndScreenRecordingPermission()}, creating onboarding window...`
);
await windowService.createOnboardingWindow();
settings.onboardingShown = true;
await settings.save();
} else {
}

if (!is.macOS || macOSHasAccessibilityAndScreenRecordingPermission()) {
LOG.debug(
`Onboarding shown: ${settings.onboardingShown}, hasAccessibilityAndScreenRecordingPermission: ${hasAccessibilityAndScreenRecordingPermission()}, starting all trackers...`
`Onboarding shown: ${settings.onboardingShown}, hasAccessibilityAndScreenRecordingPermission: ${macOSHasAccessibilityAndScreenRecordingPermission()}, starting all trackers...`
);
await trackers.startAllTrackers();
LOG.info(`Trackers started: ${trackers.getRunningTrackerNames().join(', ')}`);
Expand Down Expand Up @@ -156,7 +161,7 @@ app.on('window-all-closed', () => {
// }
});

function hasAccessibilityAndScreenRecordingPermission(): boolean {
function macOSHasAccessibilityAndScreenRecordingPermission(): boolean {
if (!is.macOS) {
return true;
}
Expand Down

0 comments on commit 6d47323

Please sign in to comment.