Merge pull request #930 from Retrospring/fix/push-enable-when-subbed

Prevent push enable prompt (inbox) when already subscribed
This commit is contained in:
Karina Kwiatek 2023-01-08 11:14:33 +00:00 committed by GitHub
commit b65242d81e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,7 @@ export default (): void => {
navigator.serviceWorker.getRegistration().then(async registration => {
const subscription = await registration?.pushManager.getSubscription();
if (subscription) {
document.querySelector('.push-settings')?.classList.add('d-none');
document.querySelector('button[data-action="push-enable"]')?.classList.add('d-none');
document.querySelector('[data-action="push-disable"]')?.classList.remove('d-none');