Skip to content

Commit

Permalink
Update notification fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr-Kniaz committed Dec 11, 2024
1 parent a195053 commit 0f6c3dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,11 @@ function showUpdateNotification(worker) {
updateNotification.show();

updateButton.addEventListener('click', () => {
updateButton.setAttribute('disabled', 'disabled');
updateServiceWorker(worker);
if (worker.state === 'activated') {
updateNotification.close();
} else {
updateButton.setAttribute('disabled', 'disabled');
updateServiceWorker(worker);
}
});
}

0 comments on commit 0f6c3dd

Please sign in to comment.