-
Notifications
You must be signed in to change notification settings - Fork 11
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: consistent launch on login menu item #33
Conversation
I don't have my MacBook around right now to check this out but I did try to fix and improve the Launch on Login functionality on multiple commits in the past. This is the last such commit f5196da. Is it still not working? |
As I commented in agungrbudiman/issues/9 , the "launch on login" works if I manually add Sudoto to login item list in System Settings. If the state is inconsistent, this menu item would not work - there's no way to turn it on or off. To trigger the issue:
Once the issue is triggered, the menu item does nothing when clicked. This PR basically removed the "mixed" state from the menu item, and treat an error state as "notRegistered". It's not something urgent, feel free to test it when you have access to a Macbook. :) |
This issue is caused by inconsistent state, and the current PR does not fully fix it. I think I fully understand what's going on now. The following content applies to code before applying this PR.
So to fully address this issue, we should either: A) have the login item state automatically synced into Soduto's memory (by using some kind of observable type in Swift), or B) update |
I've updated the code. I think it fully resolves this issue, although the code is not optimal. |
According to Apple's doc
SMAppService.Status.notFound
should only be returned when there's an error, but for some reason it is returned when the service is not registered. This PR treatsnotFound
the same asnotRegistered
, and simplifies menu item state.