erp-platform/ui/src/utils/hooks/useNotification.ts

18 lines
348 B
TypeScript
Raw Normal View History

2025-05-06 06:45:49 +00:00
import { useEffect } from 'react'
function useNotification() {
useEffect(() => {
if (window === undefined) {
return
}
if (!('Notification' in window)) {
console.log('This browser does not support desktop notification')
} else {
Notification.requestPermission()
}
}, [])
}
export default useNotification