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
Use some/every instead of doing it manually
This commit is contained in:
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user