kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Convert HTML to text value in Profile Page for Display name and Bio fields
Fixed linter errors * used unescape method from lodash to translate HTML to plain text * Moved translation to the componentDidMount event * Removed decodeHtml method from utils/htmlmerge-requests/30/merge
rodzic
a85684835f
commit
76b3849c93
|
@ -18,6 +18,7 @@ import {
|
|||
List as ImmutableList,
|
||||
} from 'immutable';
|
||||
import { patchMe } from 'gabsocial/actions/me';
|
||||
import { unescape } from 'lodash';
|
||||
|
||||
const MAX_FIELDS = 4; // TODO: Make this dynamic by the instance
|
||||
|
||||
|
@ -116,6 +117,13 @@ class EditProfile extends ImmutablePureComponent {
|
|||
this.setState(initialState.toObject());
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const display_name = unescape(this.state.display_name);
|
||||
this.setState({ display_name: display_name });
|
||||
const note = unescape(this.state.note);
|
||||
this.setState({ note: note });
|
||||
}
|
||||
|
||||
handleCheckboxChange = e => {
|
||||
this.setState({ [e.target.name]: e.target.checked });
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue