Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

CreateRoomDialog is rendered before getting the config default_federate #2078

Merged

Commits on Jul 23, 2018

  1. 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>
    psaavedra committed Jul 23, 2018
    Configuration menu
    Copy the full SHA
    77ab7d2 View commit details
    Browse the repository at this point in the history