From 4457f2ed269f54c64036605315dfc9a88f395a2e Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Thu, 5 Jan 2023 23:20:36 +0100 Subject: [PATCH] Prevent push enable prompt (inbox) when already subscribed --- app/javascript/retrospring/features/webpush/settingsButtons.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/javascript/retrospring/features/webpush/settingsButtons.ts b/app/javascript/retrospring/features/webpush/settingsButtons.ts index 6ef01a24..44e3e93d 100644 --- a/app/javascript/retrospring/features/webpush/settingsButtons.ts +++ b/app/javascript/retrospring/features/webpush/settingsButtons.ts @@ -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');