From e2b9037be1c360bcaec57a88a0eb71e1e337b8b4 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Fri, 28 Jun 2019 15:37:46 -0500 Subject: [PATCH] Fix isMounted --- src/containers/Configuration/Configuration.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/containers/Configuration/Configuration.js b/src/containers/Configuration/Configuration.js index a66f4a2..f7f3e17 100644 --- a/src/containers/Configuration/Configuration.js +++ b/src/containers/Configuration/Configuration.js @@ -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(); } });