~cytrogen/masto-fe

ref: ebd201752484c6001be92614e9b244d3f4d06e0a masto-fe/app/javascript/mastodon/actions/boosts.js -rw-r--r-- 719 bytes
ebd20175 — Georg Gadinger fix Content-Security-Policy when using Azure storage (#2427) 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
import { openModal } from './modal';

export const BOOSTS_INIT_MODAL = 'BOOSTS_INIT_MODAL';
export const BOOSTS_CHANGE_PRIVACY = 'BOOSTS_CHANGE_PRIVACY';

export function initBoostModal(props) {
  return (dispatch, getState) => {
    const default_privacy = getState().getIn(['compose', 'default_privacy']);

    const privacy = props.status.get('visibility') === 'private' ? 'private' : default_privacy;

    dispatch({
      type: BOOSTS_INIT_MODAL,
      privacy,
    });

    dispatch(openModal({
      modalType: 'BOOST',
      modalProps: props,
    }));
  };
}


export function changeBoostPrivacy(privacy) {
  return dispatch => {
    dispatch({
      type: BOOSTS_CHANGE_PRIVACY,
      privacy,
    });
  };
}