Skip to content

Don't try to render push notification settings when there are none

Jano requested to merge webpush_issues_2 into master

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

  1. Checkout branch locally
  2. Login as foodsaver
  3. Open Developer Tools/JavaScript console
  4. Go to settings page
  5. See no TypeErrors

Screenshots (if applicable)

type-error-pushnotification

type-error-pushnotification2

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

Merge request reports