This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2021-02-10 15:53:12 -08:00
|
|
|
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,
|
2023-02-03 11:52:07 -08:00
|
|
|
privacy,
|
2021-02-10 15:53:12 -08:00
|
|
|
});
|
|
|
|
|
|
|
|
dispatch(openModal('BOOST', props));
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function changeBoostPrivacy(privacy) {
|
|
|
|
return dispatch => {
|
|
|
|
dispatch({
|
|
|
|
type: BOOSTS_CHANGE_PRIVACY,
|
|
|
|
privacy,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|