Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants