mirror of
https://github.com/element-hq/element-web
synced 2024-11-22 09:15:41 +03:00
Merge pull request #2443 from vector-im/dbkr/matrix_network_join_button
Fix join button for 'matrix' networks
This commit is contained in:
commit
2a5ca9d3df
1 changed files with 11 additions and 5 deletions
|
@ -503,7 +503,11 @@ module.exports = React.createClass({
|
||||||
// matches this network. We look for a matching protocol
|
// matches this network. We look for a matching protocol
|
||||||
// and the existence of a 'domain' field and if present,
|
// and the existence of a 'domain' field and if present,
|
||||||
// its value.
|
// its value.
|
||||||
if (this.protocols[network_info.protocol].instances.length == 1) {
|
if (
|
||||||
|
this.protocols[network_info.protocol] &&
|
||||||
|
this.protocols[network_info.protocol].instances &&
|
||||||
|
this.protocols[network_info.protocol].instances.length == 1
|
||||||
|
) {
|
||||||
const the_instance = this.protocols[network_info.protocol].instances[0];
|
const the_instance = this.protocols[network_info.protocol].instances[0];
|
||||||
// If there's only one instance in this protocol, use it
|
// If there's only one instance in this protocol, use it
|
||||||
// as long as it has no domain (which we assume to mean it's
|
// as long as it has no domain (which we assume to mean it's
|
||||||
|
@ -591,10 +595,12 @@ module.exports = React.createClass({
|
||||||
placeholder = this.props.config.networks[this.state.network].example;
|
placeholder = this.props.config.networks[this.state.network].example;
|
||||||
}
|
}
|
||||||
|
|
||||||
const showJoinButton = (
|
let showJoinButton = this._stringLooksLikeId(this.state.filterString, this.state.network);
|
||||||
this._stringLooksLikeId(this.state.filterString, this.state.network) &&
|
if (this.state.network && this.state.network != '_matrix') {
|
||||||
this._getFieldsForThirdPartyLocation(this.state.filterString, this.state.network)
|
if (this._getFieldsForThirdPartyLocation(this.state.filterString, this.state.network) === null) {
|
||||||
);
|
showJoinButton = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const SimpleRoomHeader = sdk.getComponent('rooms.SimpleRoomHeader');
|
const SimpleRoomHeader = sdk.getComponent('rooms.SimpleRoomHeader');
|
||||||
const NetworkDropdown = sdk.getComponent('directory.NetworkDropdown');
|
const NetworkDropdown = sdk.getComponent('directory.NetworkDropdown');
|
||||||
|
|
Loading…
Reference in a new issue