Remove dead code

This commit is contained in:
RMidhunSuresh 2022-02-04 16:40:49 +05:30
parent e8c480426a
commit e66549a067
3 changed files with 4 additions and 9 deletions

View File

@ -77,7 +77,7 @@ export class Registration {
if (!stageClass) { if (!stageClass) {
throw new Error(`Unknown stage: ${stage}`); throw new Error(`Unknown stage: ${stage}`);
} }
const registrationStage = new stageClass(this._hsApi, this._accountDetails, session, params?.[stage]); const registrationStage = new stageClass(session, params?.[stage]);
if (!firstStage) { if (!firstStage) {
firstStage = registrationStage; firstStage = registrationStage;
lastStage = registrationStage; lastStage = registrationStage;

View File

@ -15,12 +15,11 @@ limitations under the License.
*/ */
import type {BaseRegistrationStage} from "./stages/BaseRegistrationStage"; import type {BaseRegistrationStage} from "./stages/BaseRegistrationStage";
import type {HomeServerApi} from "../net/HomeServerApi"; import type {RegistrationParams} from "./types";
import type {AccountDetails, RegistrationParams} from "./types";
import {DummyAuth} from "./stages/DummyAuth"; import {DummyAuth} from "./stages/DummyAuth";
import {TermsAuth} from "./stages/TermsAuth"; import {TermsAuth} from "./stages/TermsAuth";
type ClassDerivedFromBaseRegistration = { new(hsApi: HomeServerApi, registrationData: AccountDetails, session: string, params?: RegistrationParams): BaseRegistrationStage } & typeof BaseRegistrationStage; type ClassDerivedFromBaseRegistration = { new(session: string, params?: RegistrationParams): BaseRegistrationStage } & typeof BaseRegistrationStage;
export function registrationStageFromType(type: string): ClassDerivedFromBaseRegistration | undefined{ export function registrationStageFromType(type: string): ClassDerivedFromBaseRegistration | undefined{
switch (type) { switch (type) {

View File

@ -18,15 +18,11 @@ import type {HomeServerApi} from "../../net/HomeServerApi";
import type {AccountDetails, AuthenticationData, RegistrationParams} from "../types"; import type {AccountDetails, AuthenticationData, RegistrationParams} from "../types";
export abstract class BaseRegistrationStage { export abstract class BaseRegistrationStage {
protected readonly _hsApi: HomeServerApi;
protected readonly _accountDetails: AccountDetails;
protected _session: string; protected _session: string;
protected _nextStage: BaseRegistrationStage; protected _nextStage: BaseRegistrationStage;
protected readonly _params?: Record<string, any> protected readonly _params?: Record<string, any>
constructor(hsApi: HomeServerApi, accountDetails: AccountDetails, session: string, params?: RegistrationParams) { constructor(session: string, params?: RegistrationParams) {
this._hsApi = hsApi;
this._accountDetails = accountDetails;
this._session = session; this._session = session;
this._params = params; this._params = params;
} }