Don't mutate flows

This commit is contained in:
RMidhunSuresh 2022-02-03 12:04:13 +05:30
parent 30cb9f6d15
commit e13040a49e

View File

@ -29,7 +29,7 @@ export class Registration {
constructor(hsApi: HomeServerApi, accountDetails: AccountDetails, flowSelector?: FlowSelector) { constructor(hsApi: HomeServerApi, accountDetails: AccountDetails, flowSelector?: FlowSelector) {
this._hsApi = hsApi; this._hsApi = hsApi;
this._accountDetails = accountDetails; this._accountDetails = accountDetails;
this._flowSelector = flowSelector ?? (flows => flows.pop()); this._flowSelector = flowSelector ?? (flows => flows[0]);
} }
async start(): Promise<BaseRegistrationStage> { async start(): Promise<BaseRegistrationStage> {