From 9de4a14b322d199035cdfec8150521093c7638dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Thu, 29 Dec 2022 23:43:23 +0100 Subject: [PATCH] fix: push notification click (#643) --- service-worker/web-push-notifications.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/service-worker/web-push-notifications.ts b/service-worker/web-push-notifications.ts index 36a302be..5c37efdc 100644 --- a/service-worker/web-push-notifications.ts +++ b/service-worker/web-push-notifications.ts @@ -19,17 +19,7 @@ export const onPush = (event: PushEvent) => { preferred_locale, } = options - let url = 'home' - if (notification_type) { - switch (notification_type) { - case 'follow': - url = 'notifications' - break - case 'mention': - url = 'notifications/mention' - break - } - } + const url = notification_type === 'mention' ? 'notifications/mention' : 'notifications' const notificationOptions: NotificationOptions = { badge: '/pwa-192x192.png',