Use some/every instead of doing it manually
This commit is contained in:
parent
eced58701d
commit
32da44615e
1 changed files with 6 additions and 14 deletions
|
@ -43,20 +43,12 @@ export async function startAnyRegistrationFlow(options) {
|
||||||
// ones like email & msisdn which require the user to supply
|
// ones like email & msisdn which require the user to supply
|
||||||
// the relevant details in advance. We err on the side of
|
// the relevant details in advance. We err on the side of
|
||||||
// caution though.
|
// caution though.
|
||||||
let hasIlagFlow = false;
|
const hasIlagFlow = flows.some((flow) => {
|
||||||
for (const flow of flows) {
|
return flow.stages.every((stage) => {
|
||||||
let flowSuitable = true;
|
return ['m.login.dummy', 'm.login.recaptcha'].includes(stage);
|
||||||
for (const stage of flow.stages) {
|
});
|
||||||
if (!['m.login.dummy', 'm.login.recaptcha'].includes(stage)) {
|
});
|
||||||
flowSuitable = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (flowSuitable) {
|
|
||||||
hasIlagFlow = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (hasIlagFlow) {
|
if (hasIlagFlow) {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'view_set_mxid',
|
action: 'view_set_mxid',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue