Add Desktop notifications (#252)

* Add notifications

* Abide push actions

* Handle browsers not having notification support

* Ask for notification permission after loading

* Make usePermission work without live permission support

* Focus message when clicking the notification

* make const all caps

* Fix usePermission error in Safari

* Fix live permissions

* Remove userActivity and use document.visibilityState instead

* Change setting label to "desktop notifications"

* Check for notification permissions in the settings.js
This commit is contained in:
ginnyTheCat 2022-01-29 15:20:51 +01:00 committed by GitHub
parent d0b4e092b3
commit c828dfd596
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 174 additions and 15 deletions

View file

@ -30,3 +30,9 @@ export function toggleNickAvatarEvents() {
type: cons.actions.settings.TOGGLE_NICKAVATAR_EVENT,
});
}
export function toggleNotifications() {
appDispatcher.dispatch({
type: cons.actions.settings.TOGGLE_NOTIFICATIONS,
});
}