Redesign local-only toots in glitch flavour

This commit is contained in:
Thibaut Girka 2018-05-21 20:33:58 +02:00
parent 71b1d4c694
commit 92109c2cbe
3 changed files with 4 additions and 6 deletions

View file

@ -146,9 +146,6 @@ export function submitCompose(routerHistory) {
}
dispatch(submitComposeRequest());
if (getState().getIn(['compose', 'advanced_options', 'do_not_federate'])) {
status = status + ' 👁️';
}
api(getState).post('/api/v1/statuses', {
status,
content_type: getState().getIn(['compose', 'content_type']),
@ -158,6 +155,7 @@ export function submitCompose(routerHistory) {
spoiler_text: spoilerText,
visibility: getState().getIn(['compose', 'privacy']),
poll: getState().getIn(['compose', 'poll'], null),
local_only: getState().getIn(['compose', 'advanced_options', 'do_not_federate']),
}, {
headers: {
'Idempotency-Key': getState().getIn(['compose', 'idempotencyKey']),

View file

@ -294,7 +294,7 @@ class ComposeForm extends ImmutablePureComponent {
let disabledButton = isSubmitting || isUploading || isChangingUpload || (!text.trim().length && !anyMedia);
const countText = `${spoilerText}${countableText(text)}${advancedOptions && advancedOptions.get('do_not_federate') ? ' 👁️' : ''}`;
const countText = `${spoilerText}${countableText(text)}`;
return (
<div className='composer'>

View file

@ -177,7 +177,7 @@ function continueThread (state, status) {
map.set('in_reply_to', status.id);
map.update(
'advanced_options',
map => map.merge(new ImmutableMap({ do_not_federate: /👁\ufe0f?\u200b?(?:<\/p>)?$/.test(status.content) }))
map => map.merge(new ImmutableMap({ do_not_federate: !!status.local_only }))
);
map.set('privacy', status.visibility);
map.set('sensitive', false);
@ -338,7 +338,7 @@ export default function compose(state = initialState, action) {
map.set('privacy', privacyPreference(action.status.get('visibility'), state.get('default_privacy')));
map.update(
'advanced_options',
map => map.merge(new ImmutableMap({ do_not_federate: /👁\ufe0f?\u200b?(?:<\/p>)?$/.test(action.status.get('content')) }))
map => map.merge(new ImmutableMap({ do_not_federate: !!action.status.get('local_only') }))
);
map.set('focusDate', new Date());
map.set('caretPosition', null);