You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Extend from a Signup class to keep hs/is URL logic together
This commit is contained in:
@@ -3,14 +3,43 @@ var MatrixClientPeg = require("./MatrixClientPeg");
|
|||||||
var dis = require("./dispatcher");
|
var dis = require("./dispatcher");
|
||||||
var q = require("q");
|
var q = require("q");
|
||||||
|
|
||||||
class Register {
|
class Signup {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class Login {
|
|
||||||
constructor(hsUrl, isUrl) {
|
constructor(hsUrl, isUrl) {
|
||||||
this._hsUrl = hsUrl;
|
this._hsUrl = hsUrl;
|
||||||
this._isUrl = isUrl;
|
this._isUrl = isUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
getHomeserverUrl() {
|
||||||
|
return this._hsUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
getIdentityServerUrl() {
|
||||||
|
return this._isUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
setHomeserverUrl(hsUrl) {
|
||||||
|
this._hsUrl = hsUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
setIdentityServerUrl(isUrl) {
|
||||||
|
this._isUrl = isUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Register extends Signup {
|
||||||
|
constructor(hsUrl, isUrl) {
|
||||||
|
super(hsUrl, isUrl);
|
||||||
|
this._state = "start";
|
||||||
|
}
|
||||||
|
|
||||||
|
getState() {
|
||||||
|
return this._state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Login extends Signup {
|
||||||
|
constructor(hsUrl, isUrl) {
|
||||||
|
super(hsUrl, isUrl);
|
||||||
this._currentFlowIndex = 0;
|
this._currentFlowIndex = 0;
|
||||||
this._flows = [];
|
this._flows = [];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user