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