npwd
npwd copied to clipboard
Notifications: Add sound option to generic useNotification hook and code cleanup
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
useNotificationhook to take a new parameterplaySound- when true this will trigger the sound alert
- the notification options were also typed as
anyso I added specific types for these so its more clear on the expected shape of the options
Pull Request Checklist:
- [x] Have you followed the guidelines in our Contributing document and Code of Conduct?
- [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
- [x] Have you built and tested NPWD in-game after the relevant change?