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

Notifications: Add sound option to generic useNotification hook and code cleanup #1023

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BackSH00TER
Copy link
Contributor

Pull Request Description
Problem: When a user receives a notification, the alert does not play a sound effect.

I found that each app had its own implementation of a useAppNameNotification hook (ex: useMessageNotifications), that did have a sound option built in. I followed up with Chip in discord and he confirmed these hooks were from a previous older notification system and that they moved to a more generic approach using a single useNotification hook.

As such this PR does two things:

  • delete the now obsolete app specific notification hooks (double checked they are not used anywhere in the codebase)
  • update the generic useNotification hook to take a new parameter playSound
    • when true this will trigger the sound alert
    • the notification options were also typed as any so I added specific types for these so its more clear on the expected shape of the options

Pull Request Checklist:

  • Have you followed the guidelines in our Contributing document and Code of Conduct?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you built and tested NPWD in-game after the relevant change?

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

Successfully merging this pull request may close these issues.

1 participant