Fix getNotifications is not a function

pull/228/head
Lim Chee Aun 2023-09-07 12:17:31 +08:00
rodzic 1c295c585b
commit 61f2132abd
1 zmienionych plików z 11 dodań i 9 usunięć

Wyświetl plik

@ -206,15 +206,17 @@ function Notifications({ columnMode }) {
useEffect(() => {
if (uiState === 'default') {
(async () => {
const registration = await getRegistration();
if (registration) {
const notifications = await registration.getNotifications();
console.log('🔔 Push notifications', notifications);
// Close all notifications?
// notifications.forEach((notification) => {
// notification.close();
// });
}
try {
const registration = await getRegistration();
if (registration?.getNotifications) {
const notifications = await registration.getNotifications();
console.log('🔔 Push notifications', notifications);
// Close all notifications?
// notifications.forEach((notification) => {
// notification.close();
// });
}
} catch (e) {}
})();
}
}, [uiState]);