* 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
38 lines
855 B
JavaScript
38 lines
855 B
JavaScript
import appDispatcher from '../dispatcher';
|
|
import cons from '../state/cons';
|
|
|
|
export function toggleSystemTheme() {
|
|
appDispatcher.dispatch({
|
|
type: cons.actions.settings.TOGGLE_SYSTEM_THEME,
|
|
});
|
|
}
|
|
|
|
export function toggleMarkdown() {
|
|
appDispatcher.dispatch({
|
|
type: cons.actions.settings.TOGGLE_MARKDOWN,
|
|
});
|
|
}
|
|
|
|
export function togglePeopleDrawer() {
|
|
appDispatcher.dispatch({
|
|
type: cons.actions.settings.TOGGLE_PEOPLE_DRAWER,
|
|
});
|
|
}
|
|
|
|
export function toggleMembershipEvents() {
|
|
appDispatcher.dispatch({
|
|
type: cons.actions.settings.TOGGLE_MEMBERSHIP_EVENT,
|
|
});
|
|
}
|
|
|
|
export function toggleNickAvatarEvents() {
|
|
appDispatcher.dispatch({
|
|
type: cons.actions.settings.TOGGLE_NICKAVATAR_EVENT,
|
|
});
|
|
}
|
|
|
|
export function toggleNotifications() {
|
|
appDispatcher.dispatch({
|
|
type: cons.actions.settings.TOGGLE_NOTIFICATIONS,
|
|
});
|
|
}
|