Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: macos-notification-state not working well #1794

Merged
merged 2 commits into from
Jun 1, 2024

Conversation

Alphrag
Copy link
Member

@Alphrag Alphrag commented Jun 1, 2024

Pre-flight Checklist

Please ensure you've completed all of the following.

Description of Change

  • Add the entitlement com.apple.developer.usernotifications.communication to allow the app to use the focus state on MacOS properly.
  • Disable the typecheck when importing the macos-notification-state module, which prevented building locally on Linux and gave an error on Windows.

Motivation and Context

It seems that we have been missing a key element in the entitlement file in order to allow Focus State to work on MacOS without granting full rights on the disk to Ferdium.

Also, when building locally on Linux or Windows, the typecheck happening on the dnd.ts file fails since the module is not loaded. Adding these comments to avoid problems in the same vein that we do with node-mac-permissions there:

// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore
import { askForScreenCaptureAccess } from 'node-mac-permissions';

Important note: I have not tested whether this completely works since my mac does not support Monterrey and above, but currently, it seems to be the last missing piece of the puzzle.

This possibly resolves the following:
Fixes #1047
Fixes #798

Checklist

  • My pull request is properly named
  • The changes respect the code style of the project (pnpm prepare-code)
  • pnpm test passes
  • I tested/previewed my changes locally

Release Notes

@Alphrag Alphrag requested a review from a team June 1, 2024 15:43
@vraravam
Copy link
Contributor

vraravam commented Jun 1, 2024

Testing by changing the name of the app - in case macos ties such preferences to the name of the app, and not the profile folder itself. Things seem to be working fine
Screenshot 2024-06-01 at 9 40 10 PM

Copy link
Contributor

@vraravam vraravam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - tested on m2 mac

@Alphrag Alphrag merged commit f1790ac into ferdium:develop Jun 1, 2024
5 checks passed
@Alphrag Alphrag deleted the macos-notification branch June 1, 2024 16:22
Alphrag added a commit that referenced this pull request Jun 2, 2024
Alphrag added a commit that referenced this pull request Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants