Adding content sensitivity toggle, spoilers for media

This commit is contained in:
Eugen Rochko 2016-11-23 18:53:23 +01:00
parent 5434ad3002
commit 2112a81e86
10 changed files with 182 additions and 25 deletions

View file

@ -22,6 +22,8 @@ export const COMPOSE_SUGGESTION_SELECT = 'COMPOSE_SUGGESTION_SELECT';
export const COMPOSE_MOUNT = 'COMPOSE_MOUNT';
export const COMPOSE_UNMOUNT = 'COMPOSE_UNMOUNT';
export const COMPOSE_SENSITIVITY_CHANGE = 'COMPOSE_SENSITIVITY_CHANGE';
export function changeCompose(text) {
return {
type: COMPOSE_CHANGE,
@ -62,7 +64,8 @@ export function submitCompose() {
api(getState).post('/api/v1/statuses', {
status: getState().getIn(['compose', 'text'], ''),
in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null),
media_ids: getState().getIn(['compose', 'media_attachments']).map(item => item.get('id'))
media_ids: getState().getIn(['compose', 'media_attachments']).map(item => item.get('id')),
sensitive: getState().getIn(['compose', 'sensitive'])
}).then(function (response) {
dispatch(submitComposeSuccess(response.data));
dispatch(updateTimeline('home', response.data));
@ -197,3 +200,10 @@ export function unmountCompose() {
type: COMPOSE_UNMOUNT
};
};
export function changeComposeSensitivity(checked) {
return {
type: COMPOSE_SENSITIVITY_CHANGE,
checked
};
};