kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Fixed features/edit_profile checkbox issues. Bot value always returned true, so commented that feature out
rodzic
eeaf9f0b8e
commit
05cc7ac818
|
@ -111,8 +111,11 @@ class EditProfile extends ImmutablePureComponent {
|
|||
const data = this.getParams();
|
||||
let formData = new FormData();
|
||||
for (let key in data) {
|
||||
const shouldAppend = Boolean(data[key] || key.startsWith('fields_attributes'));
|
||||
if (shouldAppend) formData.append(key, data[key] || '');
|
||||
const shouldAppend = Boolean(data[key]
|
||||
|| key.startsWith('fields_attributes')
|
||||
|| (key === 'bot' && data.bot !== undefined)
|
||||
|| (key === 'locked' && data.locked !== undefined));
|
||||
if (shouldAppend) formData.append(key, String(data[key]) || '');
|
||||
}
|
||||
return formData;
|
||||
}
|
||||
|
@ -201,13 +204,13 @@ class EditProfile extends ImmutablePureComponent {
|
|||
checked={this.state.locked}
|
||||
onChange={this.handleCheckboxChange}
|
||||
/>
|
||||
<Checkbox
|
||||
{/* <Checkbox
|
||||
label={<FormattedMessage id='edit_profile.fields.bot_label' defaultMessage='This is a bot account' />}
|
||||
hint={<FormattedMessage id='edit_profile.hints.bot' defaultMessage='This account mainly performs automated actions and might not be monitored' />}
|
||||
name='bot'
|
||||
checked={this.state.bot}
|
||||
onChange={this.handleCheckboxChange}
|
||||
/>
|
||||
/> */}
|
||||
</FieldsGroup>
|
||||
<FieldsGroup>
|
||||
<div className='fields-row__column fields-group'>
|
||||
|
|
Ładowanie…
Reference in New Issue