npwd icon indicating copy to clipboard operation
npwd copied to clipboard

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

Open BackSH00TER opened this issue 2 years ago • 0 comments

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:

  • [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?

BackSH00TER avatar Jul 14 '23 01:07 BackSH00TER