diff --git a/src/utils/notification.ts b/src/utils/notification.ts index 6563764..9a9c288 100644 --- a/src/utils/notification.ts +++ b/src/utils/notification.ts @@ -20,27 +20,32 @@ export const notify = ( title: string, options?: NotificationOptions | undefined ) => { - try { - console.log(showNotification) - + const showCustomNotification = ( + title: string, + options?: NotificationOptions | undefined + ) => { if (!showNotification) { return } + showNotification(title, { + icon: '/img/icons/apple-touch-icon.png', + ...options + }) + } + + try { if (!('Notification' in window)) { return } else if (Notification.permission === 'granted') { - showNotification(title, options) + showCustomNotification(title, options) } else if (Notification.permission !== 'denied') { Notification.requestPermission((permission: any) => { - if (!showNotification) { - return - } if (!('permission' in Notification)) { Notification.permission = permission } if (permission === 'granted') { - showNotification(title, options) + showCustomNotification(title, options) } }) }