Don't try to render push notification settings when there are none
What does this MR do?
MR adds a null check in the push notification settings JavaScript to prevent a TypeError from happening. The JavaScript will be run on every settings subpage, but only on the notification settings page there are the inputs that should be manipulated by that function.
How confident are you it won't break things if deployed?
Very.
Links to related issues
Fixes some of #831 (closed)
How to test
- Checkout branch locally
- Login as foodsaver
- Open Developer Tools/JavaScript console
- Go to settings page
- See no TypeErrors
Screenshots (if applicable)
Checklist
-
added a test, or explain why one is not needed/possible... -
no unrelated changes -
asked someone for a code review -
joined #foodsharing-beta channel at https://slackin.yunity.org -
added an entry to CHANGELOG.md (description, merge request link, username(s)) -
Once your MR has been merged, you are responsible to update the #foodsharing-beta Slack channel about what has been changed here. They will test your work in different browsers, roles or other settings
Edited by Christian Walgenbach