From 8214ee8fad439848f60ac2fcfa1cc7909285ef5b Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 1 Sep 2015 01:35:47 +0300 Subject: [PATCH] fix blinking when toggling advanced --- skins/base/views/templates/Login.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/skins/base/views/templates/Login.js b/skins/base/views/templates/Login.js index 887c7ca7..bef13b1d 100644 --- a/skins/base/views/templates/Login.js +++ b/skins/base/views/templates/Login.js @@ -80,8 +80,19 @@ module.exports = React.createClass({ }, onHsUrlChanged: function() { - this.customHsUrl = this.refs.serverConfig.getHsUrl().trim(); - this.customIsUrl = this.refs.serverConfig.getIsUrl().trim(); + var newHsUrl = this.refs.serverConfig.getHsUrl().trim(); + var newIsUrl = this.refs.serverConfig.getIsUrl().trim(); + + if (newHsUrl == this.customHsUrl && + newIsUrl == this.customIsUrl) + { + return; + } + else { + this.customHsUrl = newHsUrl; + this.customIsUrl = newIsUrl; + } + MatrixClientPeg.replaceUsingUrls( this.getHsUrl(), this.getIsUrl()