- { _t("An email has been sent to %(emailAddress)s. Once you've followed the link it contains, click below.", { emailAddress: this.state.email }) }
+ { _t("An email has been sent to %(emailAddress)s. Once you've followed the link it contains, " +
+ "click below.", { emailAddress: this.state.email }) }
@@ -180,14 +181,15 @@ module.exports = React.createClass({
resetPasswordJsx = (
{ _t('Your password has been reset') }.
-
{ _t('You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device') }.
+
{ _t('You have been logged out of all devices and will no longer receive push notifications. ' +
+ 'To re-enable notifications, sign in again on each device') }.
);
} else {
let serverConfigSection;
- if (!SdkConfig.get().disable_custom_urls) {
+ if (!SdkConfig.get()['disable_custom_urls']) {
serverConfigSection = (
0;
- if (error.httpStatus == 400 && usingEmail) {
+ if (error.httpStatus === 400 && usingEmail) {
errorText = _t('This Home Server does not support login using email address.');
} else if (error.httpStatus === 401 || error.httpStatus === 403) {
- if (SdkConfig.get().disable_custom_urls) {
+ if (SdkConfig.get()['disable_custom_urls']) {
errorText = (
{ _t('Incorrect username and/or password.') }
@@ -143,7 +143,7 @@ module.exports = React.createClass({
// but the login API gives a 403 https://matrix.org/jira/browse/SYN-744
// mentions this (although the bug is for UI auth which is not this)
// We treat both as an incorrect password
- loginIncorrect: error.httpStatus === 401 || error.httpStatus == 403,
+ loginIncorrect: error.httpStatus === 401 || error.httpStatus === 403,
});
}).finally(() => {
if (this._unmounted) {
@@ -231,7 +231,7 @@ module.exports = React.createClass({
hsUrl = hsUrl || this.state.enteredHomeserverUrl;
isUrl = isUrl || this.state.enteredIdentityServerUrl;
- const fallbackHsUrl = hsUrl == this.props.defaultHsUrl ? this.props.fallbackHsUrl : null;
+ const fallbackHsUrl = hsUrl === this.props.defaultHsUrl ? this.props.fallbackHsUrl : null;
const loginLogic = new Login(hsUrl, isUrl, fallbackHsUrl, {
defaultDeviceDisplayName: this.props.defaultDeviceDisplayName,
@@ -310,19 +310,27 @@ module.exports = React.createClass({
!this.state.enteredHomeserverUrl.startsWith("http"))
) {
errorText =
- {
- _t("Can't connect to homeserver via HTTP when an HTTPS URL is in your browser bar. " +
- "Either use HTTPS or enable unsafe scripts.",
- {},
- { 'a': (sub) => { return { sub }; } },
+ { _t("Can't connect to homeserver via HTTP when an HTTPS URL is in your browser bar. " +
+ "Either use HTTPS or enable unsafe scripts.", {},
+ {
+ 'a': (sub) => {
+ return
+ { sub }
+ ;
+ },
+ },
) }
;
} else {
errorText =
- {
- _t("Can't connect to homeserver - please check your connectivity, ensure your homeserver's SSL certificate is trusted, and that a browser extension is not blocking requests.",
- {},
- { 'a': (sub) => { return { sub }; } },
+ { _t("Can't connect to homeserver - please check your connectivity, ensure your " +
+ "homeserver's SSL certificate is trusted, and that a browser extension " +
+ "is not blocking requests.", {},
+ {
+ 'a': (sub) => {
+ return { sub };
+ },
+ },
) }
;
}
@@ -386,21 +394,10 @@ module.exports = React.createClass({
;
}
- let returnToAppJsx;
- /*
- // with the advent of ILAG I don't think we need this any more
- if (this.props.onCancelClick) {
- returnToAppJsx =
-
- { _t('Return to app') }
- ;
- }
- */
-
let serverConfig;
let header;
- if (!SdkConfig.get().disable_custom_urls) {
+ if (!SdkConfig.get()['disable_custom_urls']) {
serverConfig =
{ loginAsGuestJsx }
- { returnToAppJsx }
{ makeLanguageSelector() }
diff --git a/src/components/structures/login/Registration.js b/src/components/structures/login/Registration.js
index 377cffc576..409234e2ed 100644
--- a/src/components/structures/login/Registration.js
+++ b/src/components/structures/login/Registration.js
@@ -23,7 +23,6 @@ import React from 'react';
import PropTypes from 'prop-types';
import sdk from '../../../index';
-import ServerConfig from '../../views/login/ServerConfig';
import MatrixClientPeg from '../../../MatrixClientPeg';
import RegistrationForm from '../../views/login/RegistrationForm';
import RtsClient from '../../../RtsClient';
@@ -64,6 +63,12 @@ module.exports = React.createClass({
onLoginClick: PropTypes.func.isRequired,
onCancelClick: PropTypes.func,
onServerConfigChange: PropTypes.func.isRequired,
+
+ rtsClient: PropTypes.shape({
+ getTeamsConfig: PropTypes.func.isRequired,
+ trackReferral: PropTypes.func.isRequired,
+ getTeam: PropTypes.func.isRequired,
+ }),
},
getInitialState: function() {
@@ -135,7 +140,7 @@ module.exports = React.createClass({
newState.isUrl = config.isUrl;
}
this.props.onServerConfigChange(config);
- this.setState(newState, function() {
+ this.setState(newState, () => {
this._replaceClient();
});
},
@@ -161,11 +166,11 @@ module.exports = React.createClass({
let msg = response.message || response.toString();
// can we give a better error message?
if (response.required_stages && response.required_stages.indexOf('m.login.msisdn') > -1) {
- let msisdn_available = false;
+ let msisdnAvailable = false;
for (const flow of response.available_flows) {
- msisdn_available |= flow.stages.indexOf('m.login.msisdn') > -1;
+ msisdnAvailable |= flow.stages.indexOf('m.login.msisdn') > -1;
}
- if (!msisdn_available) {
+ if (!msisdnAvailable) {
msg = _t('This server does not support authentication with a phone number.');
}
}
@@ -244,7 +249,7 @@ module.exports = React.createClass({
return matrixClient.getPushers().then((resp)=>{
const pushers = resp.pushers;
for (let i = 0; i < pushers.length; ++i) {
- if (pushers[i].kind == 'email') {
+ if (pushers[i].kind === 'email') {
const emailPusher = pushers[i];
emailPusher.data = { brand: this.props.brand };
matrixClient.setPusher(emailPusher).done(() => {
@@ -269,7 +274,7 @@ module.exports = React.createClass({
errMsg = _t('Passwords don\'t match.');
break;
case "RegistrationForm.ERR_PASSWORD_LENGTH":
- errMsg = _t('Password too short (min %(MIN_PASSWORD_LENGTH)s).', {MIN_PASSWORD_LENGTH: MIN_PASSWORD_LENGTH});
+ errMsg = _t('Password too short (min %(MIN_PASSWORD_LENGTH)s).', {MIN_PASSWORD_LENGTH});
break;
case "RegistrationForm.ERR_EMAIL_INVALID":
errMsg = _t('This doesn\'t look like a valid email address.');
@@ -355,7 +360,7 @@ module.exports = React.createClass({
registerBody = ;
} else {
let serverConfigSection;
- if (!SdkConfig.get().disable_custom_urls) {
+ if (!SdkConfig.get()['disable_custom_urls']) {
serverConfigSection = (
- { _t('Return to app') }
-
- );
- }
- */
-
let header;
let errorText;
// FIXME: remove hardcoded Status team tweaks at some point
@@ -433,7 +426,6 @@ module.exports = React.createClass({
{ registerBody }
{ signIn }
{ errorText }
- { returnToAppJsx }
{ makeLanguageSelector() }