mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Don't use _matrix as default if there isn't one
This commit is contained in:
parent
b2dd3ecf3a
commit
a32abae5a3
@ -18,8 +18,8 @@ import React from 'react';
|
|||||||
import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
|
import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
|
||||||
|
|
||||||
export default class NetworkDropdown extends React.Component {
|
export default class NetworkDropdown extends React.Component {
|
||||||
constructor() {
|
constructor(props) {
|
||||||
super();
|
super(props);
|
||||||
|
|
||||||
this.dropdownRootElement = null;
|
this.dropdownRootElement = null;
|
||||||
this.ignoreEvent = null;
|
this.ignoreEvent = null;
|
||||||
@ -34,10 +34,20 @@ export default class NetworkDropdown extends React.Component {
|
|||||||
|
|
||||||
this.inputTextBox = null;
|
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 = {
|
this.state = {
|
||||||
expanded: false,
|
expanded: false,
|
||||||
selectedServer: MatrixClientPeg.getHomeServerName(),
|
selectedServer: MatrixClientPeg.getHomeServerName(),
|
||||||
selectedNetwork: '_matrix',
|
selectedNetwork: defaultNetwork,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user