Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Support m.login.terms during registration #2221

Merged
merged 2 commits into from
Oct 16, 2018
Merged

Conversation

turt2live
Copy link
Member

@turt2live turt2live commented Oct 15, 2018

@turt2live turt2live requested a review from a team October 15, 2018 22:41
// Pick a language based on the user's language, falling back to english,
// and finally to the first language available. If there's still no policy
// available then the homeserver isn't respecting the spec.
const availableLangs = Object.keys(policy).filter(e => e !== "version");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: move inside if below so it's only done when needed. Since you're only using the first one, could use find instead of filter.

// available then the homeserver isn't respecting the spec.
const availableLangs = Object.keys(policy).filter(e => e !== "version");
let langPolicy = policy[prefLang];
if (!langPolicy) langPolicy = "en";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the code below assumes langPolicy is an object. Should this be policy.en?

@turt2live turt2live self-assigned this Oct 16, 2018
@turt2live turt2live removed their assignment Oct 16, 2018
@turt2live
Copy link
Member Author

The travis-ci builds passed more than 5 minutes ago, but the commit status didn't make it here - merging.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants