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

6. Handle Permission Denied #42

Open
kshitijahuja opened this issue May 2, 2017 · 3 comments
Open

6. Handle Permission Denied #42

kshitijahuja opened this issue May 2, 2017 · 3 comments

Comments

@kshitijahuja
Copy link

In the titled part of the codelab, should not the following code line towards the end of the function updateBtn should be removed as it otherwise turns the button ON back?

pushButton.disabled = false;

@gauntface
Copy link
Contributor

Sorry can you provide links to the relevant page on the codelab or the specific section - I don't know what you are referring to.

@kshitijahuja
Copy link
Author

kshitijahuja commented May 2, 2017 via email

@gauntface
Copy link
Contributor

hhmmm can you give me some reproduction steps? The button should be disabled by the notification permission check

function updateBtn() {
  if (Notification.permission === 'denied') {
    pushButton.textContent = 'Push Messaging Blocked.';
    pushButton.disabled = true;
    updateSubscriptionOnServer(null);
    return;
  }

  if (isSubscribed) {
    pushButton.textContent = 'Disable Push Messaging';
  } else {
    pushButton.textContent = 'Enable Push Messaging';
  }

  pushButton.disabled = false;
}

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

No branches or pull requests

2 participants