Lose underscore
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
459e028137
commit
26ae71f093
1 changed files with 6 additions and 6 deletions
|
@ -57,7 +57,7 @@ interface IState {
|
||||||
*/
|
*/
|
||||||
@replaceableComponent("views.elements.EditableTextContainer")
|
@replaceableComponent("views.elements.EditableTextContainer")
|
||||||
export default class EditableTextContainer extends React.Component<IProps, IState> {
|
export default class EditableTextContainer extends React.Component<IProps, IState> {
|
||||||
private _unmounted = false;
|
private unmounted = false;
|
||||||
public static defaultProps: Partial<IProps> = {
|
public static defaultProps: Partial<IProps> = {
|
||||||
initialValue: "",
|
initialValue: "",
|
||||||
placeholder: "",
|
placeholder: "",
|
||||||
|
@ -82,13 +82,13 @@ export default class EditableTextContainer extends React.Component<IProps, IStat
|
||||||
this.setState({ busy: true });
|
this.setState({ busy: true });
|
||||||
try {
|
try {
|
||||||
const initialValue = await this.props.getInitialValue();
|
const initialValue = await this.props.getInitialValue();
|
||||||
if (this._unmounted) return;
|
if (this.unmounted) return;
|
||||||
this.setState({
|
this.setState({
|
||||||
busy: false,
|
busy: false,
|
||||||
value: initialValue,
|
value: initialValue,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (this._unmounted) return;
|
if (this.unmounted) return;
|
||||||
this.setState({
|
this.setState({
|
||||||
errorString: error.toString(),
|
errorString: error.toString(),
|
||||||
busy: false,
|
busy: false,
|
||||||
|
@ -97,7 +97,7 @@ export default class EditableTextContainer extends React.Component<IProps, IStat
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentWillUnmount(): void {
|
public componentWillUnmount(): void {
|
||||||
this._unmounted = true;
|
this.unmounted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private onValueChanged = (value: string, shouldSubmit: boolean): void => {
|
private onValueChanged = (value: string, shouldSubmit: boolean): void => {
|
||||||
|
@ -112,14 +112,14 @@ export default class EditableTextContainer extends React.Component<IProps, IStat
|
||||||
|
|
||||||
this.props.onSubmit(value).then(
|
this.props.onSubmit(value).then(
|
||||||
() => {
|
() => {
|
||||||
if (this._unmounted) { return; }
|
if (this.unmounted) { return; }
|
||||||
this.setState({
|
this.setState({
|
||||||
busy: false,
|
busy: false,
|
||||||
value: value,
|
value: value,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
if (this._unmounted) { return; }
|
if (this.unmounted) { return; }
|
||||||
this.setState({
|
this.setState({
|
||||||
errorString: error.toString(),
|
errorString: error.toString(),
|
||||||
busy: false,
|
busy: false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue