Allow specifying a custom defaultHomeServer

This commit is contained in:
Will Hunt 2021-03-30 17:43:03 +01:00
parent f4bb95f459
commit 6bdf7f1ee9
3 changed files with 7 additions and 2 deletions

View File

@ -3,5 +3,6 @@
"appId": "io.element.hydrogen.web",
"gatewayUrl": "https://matrix.org",
"applicationServerKey": "BC-gpSdVHEXhvHSHS0AzzWrQoukv2BE7KzpoPO_FfPacqOo3l1pdqz7rSgmB04pZCWaHPz7XRe6fjLaC-WPDopM"
}
},
"defaultHomeServer": "matrix.org"
}

View File

@ -99,7 +99,7 @@ export class RootViewModel extends ViewModel {
_showLogin() {
this._setSection(() => {
this._loginViewModel = new LoginViewModel(this.childOptions({
defaultHomeServer: "https://matrix.org",
defaultHomeServer: this.platform.config["defaultHomeServer"],
createSessionContainer: this._createSessionContainer,
ready: sessionContainer => {
// we don't want to load the session container again,

View File

@ -125,6 +125,10 @@ export class Platform {
return loadOlm(this._config.olm);
}
get config() {
return this._config;
}
async loadOlmWorker() {
if (!window.WebAssembly) {
return await loadOlmWorker(this._config);