(FEAT) Allow turning off push notifications in app preferences #179
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem statement
Personally, I find push notifications for each new song to be a bit distracting, but I understand that others may like to have them.
Proposed solution
I've added a general preference pane that includes a setting to toggle the push notifications on and off. It's enabled by default to preserve the previous behaviour for existing users.
Evidence of testing
Ensured that the push notifications are still being displayed when the setting is turned on.
Checked that the notifications aren't being displayed when the preference is turned off (no screenshot).
Ensured that the new pane displays remembers the last setting:
Regression tested the push notifications pane to ensure that it is displayed correctly:
Additional changes
While working through the preference changes, I've noticed a few things that could be improved, so I've included them here. Let me know if you'd rather not have them or have them in a separate PR:
PreferencesViewController
toHotkeyPreferencesViewController
. Now that we have general and hokey preference panes, it makes sense to give a more descriptive name.guard let variable
syntax instead of the legacyguard let variable = variable
to unwrap optionals.