mirror of https://github.com/vector-im/riot-web
Make new login style work
parent
d08c47a328
commit
8ccce4d702
|
@ -19,6 +19,7 @@ limitations under the License.
|
||||||
var React = require('react');
|
var React = require('react');
|
||||||
|
|
||||||
var ComponentBroker = require("../../../../src/ComponentBroker");
|
var ComponentBroker = require("../../../../src/ComponentBroker");
|
||||||
|
var MatrixClientPeg = require("../../../../src/MatrixClientPeg");
|
||||||
|
|
||||||
var ProgressBar = ComponentBroker.get("molecules/ProgressBar");
|
var ProgressBar = ComponentBroker.get("molecules/ProgressBar");
|
||||||
var Loader = require("react-loader");
|
var Loader = require("react-loader");
|
||||||
|
@ -48,7 +49,7 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
getHsUrl: function() {
|
getHsUrl: function() {
|
||||||
if (this.state.serverConfigVisible) {
|
if (this.state.serverConfigVisible) {
|
||||||
return this.refs.serverConfig.getHsUrl();
|
return this.customHsUrl;
|
||||||
} else {
|
} else {
|
||||||
return this.DEFAULT_HS_URL;
|
return this.DEFAULT_HS_URL;
|
||||||
}
|
}
|
||||||
|
@ -56,7 +57,7 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
getIsUrl: function() {
|
getIsUrl: function() {
|
||||||
if (this.state.serverConfigVisible) {
|
if (this.state.serverConfigVisible) {
|
||||||
return this.refs.serverConfig.getIsUrl();
|
return this.customIsUrl;
|
||||||
} else {
|
} else {
|
||||||
return this.DEFAULT_IS_URL;
|
return this.DEFAULT_IS_URL;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +66,7 @@ module.exports = React.createClass({
|
||||||
onServerConfigVisibleChange: function(ev) {
|
onServerConfigVisibleChange: function(ev) {
|
||||||
this.setState({
|
this.setState({
|
||||||
serverConfigVisible: ev.target.checked
|
serverConfigVisible: ev.target.checked
|
||||||
});
|
}, this.onHsUrlChanged);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -79,12 +80,23 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onHsUrlChanged: function() {
|
onHsUrlChanged: function() {
|
||||||
this.customHsUrl = this.getHsUrl();
|
this.customHsUrl = this.refs.serverConfig.getHsUrl();
|
||||||
this.customIsUrl = this.getIsUrl();
|
this.customIsUrl = this.refs.serverConfig.getIsUrl();
|
||||||
if (this.updateHsTimeout) {
|
MatrixClientPeg.replaceUsingUrls(
|
||||||
|
this.getHsUrl(),
|
||||||
|
this.getIsUrl()
|
||||||
|
);
|
||||||
|
this.setState({
|
||||||
|
hs_url: this.getHsUrl(),
|
||||||
|
is_url: this.getIsUrl()
|
||||||
|
});
|
||||||
|
// XXX: HSes do not have to offer password auth, so we
|
||||||
|
// need to update and maybe show a different component
|
||||||
|
// when a new HS is entered.
|
||||||
|
/*if (this.updateHsTimeout) {
|
||||||
clearTimeout(this.updateHsTimeout);
|
clearTimeout(this.updateHsTimeout);
|
||||||
}
|
}
|
||||||
/*var self = this;
|
var self = this;
|
||||||
this.updateHsTimeout = setTimeout(function() {
|
this.updateHsTimeout = setTimeout(function() {
|
||||||
self.onHSChosen();
|
self.onHSChosen();
|
||||||
}, 500);*/
|
}, 500);*/
|
||||||
|
|
Loading…
Reference in New Issue