mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-29 04:38:55 +03:00
Fix getNotifications is not a function
This commit is contained in:
parent
1c295c585b
commit
61f2132abd
1 changed files with 11 additions and 9 deletions
|
@ -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]);
|
||||
|
|
Loading…
Reference in a new issue