gab-social/app/javascript/gabsocial/actions/push_notifications/setter.js

27 lines
661 B
JavaScript
Raw Normal View History

2020-11-15 18:48:32 +00:00
export const SET_BROWSER_SUPPORT = 'PUSH_NOTIFICATIONS_SET_BROWSER_SUPPORT'
export const SET_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_SET_SUBSCRIPTION'
export const CLEAR_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_CLEAR_SUBSCRIPTION'
export const SET_ALERTS = 'PUSH_NOTIFICATIONS_SET_ALERTS'
2019-07-02 08:10:25 +01:00
2020-11-15 18:48:32 +00:00
export const setBrowserSupport = (value) => ({
type: SET_BROWSER_SUPPORT,
value,
})
2019-07-02 08:10:25 +01:00
2020-11-15 18:48:32 +00:00
export const setSubscription = (subscription) => ({
type: SET_SUBSCRIPTION,
subscription,
})
2019-07-02 08:10:25 +01:00
2020-11-15 18:48:32 +00:00
export const clearSubscription = () => ({
type: CLEAR_SUBSCRIPTION,
})
2019-07-02 08:10:25 +01:00
2020-11-15 18:48:32 +00:00
export const setAlerts = (path, value) => (dispatch) => {
dispatch({
type: SET_ALERTS,
path,
value,
})
2019-07-02 08:10:25 +01:00
}