2021-02-10 18:53:12 -05: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,
|
2021-05-11 08:17:38 -04:00
|
|
|
privacy,
|
2021-02-10 18:53:12 -05:00
|
|
|
});
|
|
|
|
|
2023-05-25 09:42:37 -04:00
|
|
|
dispatch(openModal({
|
|
|
|
modalType: 'BOOST',
|
|
|
|
modalProps: props,
|
|
|
|
}));
|
2021-02-10 18:53:12 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function changeBoostPrivacy(privacy) {
|
|
|
|
return dispatch => {
|
|
|
|
dispatch({
|
|
|
|
type: BOOSTS_CHANGE_PRIVACY,
|
|
|
|
privacy,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|