Skip to content

Commit 2247d95

Browse files
committed
Add config file for default hs/is urls
1 parent 7b9cd7c commit 2247d95

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

‎config.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"default_hs_url": "https://matrix.org",
3+
"default_is_url": "https://vector.im"
4+
}

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"babel-loader": "^5.3.2",
4040
"catw": "^1.0.1",
4141
"http-server": "^0.8.4",
42+
"json-loader": "^0.5.3",
4243
"parallelshell": "^1.2.0",
4344
"rimraf": "^2.4.3",
4445
"source-map-loader": "^0.1.5",

‎src/skins/vector/views/templates/Login.js‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ var Loader = require("react-loader");
2525

2626
var LoginController = require('matrix-react-sdk/lib/controllers/templates/Login')
2727

28-
module.exports = React.createClass({
29-
DEFAULT_HS_URL: 'https://matrix.org',
30-
DEFAULT_IS_URL: 'https://vector.im',
28+
var config = require('../../../../../config.json');
3129

30+
module.exports = React.createClass({
3231
displayName: 'Login',
3332
mixins: [LoginController],
3433

@@ -40,23 +39,23 @@ module.exports = React.createClass({
4039

4140
componentWillMount: function() {
4241
this.onHSChosen();
43-
this.customHsUrl = this.DEFAULT_HS_URL;
44-
this.customIsUrl = this.DEFAULT_IS_URL;
42+
this.customHsUrl = config.default_hs_url;
43+
this.customIsUrl = config.default_is_url;
4544
},
4645

4746
getHsUrl: function() {
4847
if (this.state.serverConfigVisible) {
4948
return this.customHsUrl;
5049
} else {
51-
return this.DEFAULT_HS_URL;
50+
return config.default_hs_url;
5251
}
5352
},
5453

5554
getIsUrl: function() {
5655
if (this.state.serverConfigVisible) {
5756
return this.customIsUrl;
5857
} else {
59-
return this.DEFAULT_IS_URL;
58+
return config.default_is_url;
6059
}
6160
},
6261

0 commit comments

Comments
 (0)