forked from mystiq/hydrogen-web
Merge pull request #307 from vector-im/hs/deault-hs-url
Allow specifying a custom defaultHomeServer
This commit is contained in:
commit
1505f2d101
4 changed files with 8 additions and 2 deletions
|
@ -3,5 +3,6 @@
|
|||
"appId": "io.element.hydrogen.web",
|
||||
"gatewayUrl": "https://matrix.org",
|
||||
"applicationServerKey": "BC-gpSdVHEXhvHSHS0AzzWrQoukv2BE7KzpoPO_FfPacqOo3l1pdqz7rSgmB04pZCWaHPz7XRe6fjLaC-WPDopM"
|
||||
}
|
||||
},
|
||||
"defaultHomeServer": "matrix.org"
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
main(new Platform(document.body, {
|
||||
worker: "src/worker.js",
|
||||
downloadSandbox: "assets/download-sandbox.html",
|
||||
defaultHomeServer: "matrix.org",
|
||||
// NOTE: uncomment this if you want the service worker for local development
|
||||
// serviceWorker: "sw.js",
|
||||
// NOTE: provide push config if you want push notifs for local development
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue