Skip to content
Snippets Groups Projects
Unverified Commit d4f9694c authored by R Midhun Suresh's avatar R Midhun Suresh Committed by GitHub
Browse files

Merge pull request #17 from vector-im/fix-14

Don't die if terms login stage is not found
parents f6daffe2 c3f476c7
No related branches found
No related tags found
No related merge requests found
......@@ -28,11 +28,13 @@ export class AccountSetupViewModel extends ViewModel {
this._registration = await this._client.startRegistration(this._homeserver, username, this._password, "Chatterbox");
this._startStage = await this._registration.start();
let stage = this._startStage;
while (stage.type !== "m.login.terms") {
while (stage && stage.type !== "m.login.terms") {
stage = stage.nextStage;
if (!stage) {
throw new Error("Terms login stage not found");
}
}
if (!stage) {
// If terms login stage is not found, go straight to completeRegistration()
this.completeRegistration();
return;
}
this._privacyPolicyLink = stage.privacyPolicy.en?.url;
this.emitChange("privacyPolicyLink");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment