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

Support m.login.terms during registration#2221

Merged
turt2live merged 2 commits into
developfrom
travis/tos-register
Oct 16, 2018
Merged

Support m.login.terms during registration#2221
turt2live merged 2 commits into
developfrom
travis/tos-register

Conversation

@turt2live
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread src/components/views/login/InteractiveAuthEntryComponents.js
// 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
Copy Markdown
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 requested a review from bwindels October 16, 2018 15:20
@turt2live turt2live removed their assignment Oct 16, 2018
@turt2live
Copy link
Copy Markdown
Member Author

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

@turt2live turt2live merged commit fbadb58 into develop Oct 16, 2018
@turt2live turt2live deleted the travis/tos-register branch October 16, 2018 15:47
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