mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-17 20:32:56 +00:00
155424e52f
I don't like it changing files this way, but it's basically what
c49213f0ea
and a few others did.
30 lines
675 B
JavaScript
30 lines
675 B
JavaScript
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('BOOST', props));
|
|
};
|
|
}
|
|
|
|
|
|
export function changeBoostPrivacy(privacy) {
|
|
return dispatch => {
|
|
dispatch({
|
|
type: BOOSTS_CHANGE_PRIVACY,
|
|
privacy,
|
|
});
|
|
};
|
|
}
|