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

Reading incorrect value of the ‘Hide Notification Badges’ toggle #6

Closed
dvagala opened this issue Sep 23, 2022 · 4 comments
Closed

Comments

@dvagala
Copy link
Contributor

dvagala commented Sep 23, 2022

Steps to reproduce:

  1. Create a new focus mode on iOS with ‘Hide Notification Badges’ option disabled. The app is behaving correctly.
  2. Enable the ‘Hide Notification Badges’ option on iOS on that focus mode. The app noticed this and correctly turn off badges on mac os.
  3. Disable the ‘Hide Notification Badges’ option on iOS on that focus mode. The app is reading incorrect value, it is not able to turn on the notification badges. Trying to switching between the other focus modes and still not reading the correct value.

iOS 15.6.1
Mac Os 12.4

@dvagala dvagala changed the title Reading incerrect value of the ‘Hide Notification Badges’ toggle Reading incorrect value of the ‘Hide Notification Badges’ toggle Sep 23, 2022
@dvagala
Copy link
Contributor Author

dvagala commented Sep 23, 2022

Okay, I've done some testing:

activeMode.configuration == 2 // ‘Hide Notification Badges’ enabled
activeMode.configuration == 1 // ‘Hide Notification Badges’ disabled

The issue is that in the code we are checking against the 0

        var shouldHideApplicationBadges: Bool {
            return _hideApplicationBadges != 0
        }

I don't know the context, but the quick fix would be

        var shouldHideApplicationBadges: Bool {
            return _hideApplicationBadges == 2
        }

@aydenp
Copy link
Owner

aydenp commented Oct 23, 2022

Interesting -- I was consistently getting 0 and 2 during testing, but this would still make some sense. Maybe I hadn't tested hard enough.

Could you make a PR for this so you get credit?

@dvagala
Copy link
Contributor Author

dvagala commented Oct 24, 2022

@aydenp Sure! Here it is #7

@aydenp
Copy link
Owner

aydenp commented Oct 25, 2022

Fixed in #7 ^

@aydenp aydenp closed this as completed Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants