Compose form in the UI now has public/private toggle instead of public/unlisted

This commit is contained in:
Eugen Rochko 2016-12-23 00:38:16 +01:00
parent b302b9202b
commit de9b6e3a6a
5 changed files with 10 additions and 10 deletions

View File

@ -67,14 +67,14 @@ export function submitCompose() {
in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null),
media_ids: getState().getIn(['compose', 'media_attachments']).map(item => item.get('id')),
sensitive: getState().getIn(['compose', 'sensitive']),
visibility: getState().getIn(['compose', 'unlisted']) ? 'unlisted' : 'public'
visibility: getState().getIn(['compose', 'private']) ? 'private' : 'public'
}).then(function (response) {
dispatch(submitComposeSuccess({ ...response.data }));
// To make the app more responsive, immediately get the status into the columns
dispatch(updateTimeline('home', { ...response.data }));
if (response.data.in_reply_to_id === null && !getState().getIn(['compose', 'unlisted'])) {
if (response.data.in_reply_to_id === null && !getState().getIn(['compose', 'private'])) {
dispatch(updateTimeline('public', { ...response.data }));
}
}).catch(function (error) {

View File

@ -117,8 +117,8 @@ const ComposeForm = React.createClass({
</div>
<label style={{ display: 'block', lineHeight: '24px', verticalAlign: 'middle', marginTop: '10px', borderTop: '1px solid #282c37', paddingTop: '10px' }}>
<Toggle checked={this.props.unlisted} onChange={this.handleChangeVisibility} />
<span style={{ display: 'inline-block', verticalAlign: 'middle', marginBottom: '14px', marginLeft: '8px', color: '#9baec8' }}><FormattedMessage id='compose_form.unlisted' defaultMessage='Do not show on public timeline' /></span>
<Toggle checked={this.props.private} onChange={this.handleChangeVisibility} />
<span style={{ display: 'inline-block', verticalAlign: 'middle', marginBottom: '14px', marginLeft: '8px', color: '#9baec8' }}><FormattedMessage id='compose_form.private' defaultMessage='Mark as private' /></span>
</label>
<label style={{ display: 'block', lineHeight: '24px', verticalAlign: 'middle' }}>

View File

@ -21,7 +21,7 @@ const makeMapStateToProps = () => {
suggestion_token: state.getIn(['compose', 'suggestion_token']),
suggestions: state.getIn(['compose', 'suggestions']),
sensitive: state.getIn(['compose', 'sensitive']),
unlisted: state.getIn(['compose', 'unlisted']),
private: state.getIn(['compose', 'private']),
is_submitting: state.getIn(['compose', 'is_submitting']),
is_uploading: state.getIn(['compose', 'is_uploading']),
in_reply_to: getStatus(state, state.getIn(['compose', 'in_reply_to']))

View File

@ -37,8 +37,8 @@ const en = {
"tabs_bar.notifications": "Notifications",
"compose_form.placeholder": "What is on your mind?",
"compose_form.publish": "Toot",
"compose_form.sensitive": "Mark content as sensitive",
"compose_form.unlisted": "Do not show on public timeline",
"compose_form.sensitive": "Mark media as sensitive",
"compose_form.private": "Mark as private",
"navigation_bar.settings": "Settings",
"navigation_bar.public_timeline": "Public timeline",
"navigation_bar.logout": "Logout",

View File

@ -26,7 +26,7 @@ import Immutable from 'immutable';
const initialState = Immutable.Map({
mounted: false,
sensitive: false,
unlisted: false,
private: false,
text: '',
in_reply_to: null,
is_submitting: false,
@ -92,7 +92,7 @@ export default function compose(state = initialState, action) {
case COMPOSE_SENSITIVITY_CHANGE:
return state.set('sensitive', action.checked);
case COMPOSE_VISIBILITY_CHANGE:
return state.set('unlisted', action.checked);
return state.set('private', action.checked);
case COMPOSE_CHANGE:
return state.set('text', action.text);
case COMPOSE_REPLY:
@ -136,7 +136,7 @@ export default function compose(state = initialState, action) {
return state;
}
case ACCOUNT_SET_SELF:
return state.set('me', action.account.id);
return state.set('me', action.account.id).set('private', action.account.locked);
default:
return state;
}