diff --git a/src/utils/notification.ts b/src/utils/notification.ts index b6c32a4..bb1dcc1 100644 --- a/src/utils/notification.ts +++ b/src/utils/notification.ts @@ -9,22 +9,17 @@ export const setNotificationInstance = (sn: ShowNotification) => { showNotification = sn } -export const notify: ShowNotification = async ( - title: string, - options?: NotificationOptions -) => { - const showCustomNotification = ( - title: string, - options?: NotificationOptions - ) => { +export const notify: ShowNotification = async (title, options?) => { + const showCustomNotification = async () => { if (!showNotification) { return } - showNotification(title, { + await showNotification(title, { icon: '/img/icons/apple-touch-icon.png', badge: '/img/badge.png', tag: 'binome', renotify: true, + silent: true, ...options }) } @@ -35,7 +30,7 @@ export const notify: ShowNotification = async ( } if (Notification.permission === 'granted') { - showCustomNotification(title, options) + showCustomNotification() return } @@ -43,7 +38,7 @@ export const notify: ShowNotification = async ( const permission = await Notification.requestPermission() if (permission === 'granted') { - showCustomNotification(title, options) + showCustomNotification() } } } catch (error) {