Fix isMounted
This commit is contained in:
@@ -20,6 +20,8 @@ class Configuration extends IPCContainer {
|
|||||||
this.setRequestHandler(Constants.IPC_Set_Config_Values_Reply, this.onSetConfigValuesReply);
|
this.setRequestHandler(Constants.IPC_Set_Config_Values_Reply, this.onSetConfigValuesReply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_isMounted = false;
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
ChangedItems: [],
|
ChangedItems: [],
|
||||||
ChangedObjectLookup: null,
|
ChangedObjectLookup: null,
|
||||||
@@ -70,12 +72,18 @@ class Configuration extends IPCContainer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
this._isMounted = true;
|
||||||
this.sendRequest(Constants.IPC_Get_Config_Template, {
|
this.sendRequest(Constants.IPC_Get_Config_Template, {
|
||||||
Provider: this.props.DisplayConfiguration,
|
Provider: this.props.DisplayConfiguration,
|
||||||
Version: this.props.version,
|
Version: this.props.version,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
this._isMounted = false;
|
||||||
|
super.componentWillUnmount();
|
||||||
|
}
|
||||||
|
|
||||||
createItemList = (config, template) => {
|
createItemList = (config, template) => {
|
||||||
const objectList = [];
|
const objectList = [];
|
||||||
const itemList = Object
|
const itemList = Object
|
||||||
@@ -162,7 +170,7 @@ class Configuration extends IPCContainer {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.props.notifyError(arg.data.Error, false, () => {
|
this.props.notifyError(arg.data.Error, false, () => {
|
||||||
if (this.isMounted()) {
|
if (this._isMounted) {
|
||||||
this.props.hideConfiguration();
|
this.props.hideConfiguration();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user