Don't use _matrix as default if there isn't one
This commit is contained in:
parent
b2dd3ecf3a
commit
a32abae5a3
1 changed files with 13 additions and 3 deletions
|
@ -18,8 +18,8 @@ import React from 'react';
|
|||
import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
|
||||
|
||||
export default class NetworkDropdown extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.dropdownRootElement = null;
|
||||
this.ignoreEvent = null;
|
||||
|
@ -34,10 +34,20 @@ export default class NetworkDropdown extends React.Component {
|
|||
|
||||
this.inputTextBox = null;
|
||||
|
||||
let defaultNetwork = null;
|
||||
if (
|
||||
this.props.config.serverConfig &&
|
||||
this.props.config.serverConfig[server] &&
|
||||
this.props.config.serverConfig[server].networks &&
|
||||
'_matrix' in this.props.config.serverConfig[server].networks
|
||||
) {
|
||||
defaultNetwork = '_matrix';
|
||||
}
|
||||
|
||||
this.state = {
|
||||
expanded: false,
|
||||
selectedServer: MatrixClientPeg.getHomeServerName(),
|
||||
selectedNetwork: '_matrix',
|
||||
selectedNetwork: defaultNetwork,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue