~cytrogen/masto-fe

ref: 9b2bc3d1de301c686208b43a8efef5bc808f8e4e masto-fe/app/javascript/mastodon/actions/push_notifications/setter.js -rw-r--r-- 734 bytes
9b2bc3d1 — Eugen Rochko Add recent searches in web UI (#26834) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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';

export function setBrowserSupport (value) {
  return {
    type: SET_BROWSER_SUPPORT,
    value,
  };
}

export function setSubscription (subscription) {
  return {
    type: SET_SUBSCRIPTION,
    subscription,
  };
}

export function clearSubscription () {
  return {
    type: CLEAR_SUBSCRIPTION,
  };
}

export function setAlerts (path, value) {
  return dispatch => {
    dispatch({
      type: SET_ALERTS,
      path,
      value,
    });
  };
}