CreateRoomDialog is rendered before get default_federate value
In React the order of the execution of mount and render functions is: `componentWillMount --> render --> componentDidMount` The `CreateRoomDialog` `render()` function is executed before than the `componentDidMount()` function so the `this.defaultNoFederate = config.default_federate === false;` ; instruction which is executed in the `componentDidMount` function (in `CreateRoomDialog`) is evaluated always after than the rendering of the page. Therefore, the obvious issue is that the values obtained from the `SdkConfig.get()` function (`config.default_federate`) are obtained later than their usage on `render()`. This patch makes this change to fix the described issue: * componentWillMount instead of componentDidMount Signed-off-by: Pablo Saavedra <psaavedra@igalia.com>
This commit is contained in:
parent
fc29e89f63
commit
77ab7d2589
1 changed files with 1 additions and 1 deletions
|
@ -26,7 +26,7 @@ export default React.createClass({
|
||||||
onFinished: PropTypes.func.isRequired,
|
onFinished: PropTypes.func.isRequired,
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount: function() {
|
componentWillMount: function() {
|
||||||
const config = SdkConfig.get();
|
const config = SdkConfig.get();
|
||||||
// Dialog shows inverse of m.federate (noFederate) strict false check to skip undefined check (default = true)
|
// Dialog shows inverse of m.federate (noFederate) strict false check to skip undefined check (default = true)
|
||||||
this.defaultNoFederate = config.default_federate === false;
|
this.defaultNoFederate = config.default_federate === false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue