Fix lint
This commit is contained in:
parent
3b439d4bb2
commit
fea0a941ce
1 changed files with 10 additions and 5 deletions
|
@ -20,7 +20,6 @@ import sdk from '../../../index';
|
||||||
import dis from '../../../dispatcher';
|
import dis from '../../../dispatcher';
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import MatrixClientPeg from '../../../MatrixClientPeg';
|
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||||
import AccessibleButton from '../elements/AccessibleButton';
|
|
||||||
|
|
||||||
// We match fairly liberally and leave it up to the server to reject if
|
// We match fairly liberally and leave it up to the server to reject if
|
||||||
// there are invalid characters etc.
|
// there are invalid characters etc.
|
||||||
|
@ -62,14 +61,17 @@ export default React.createClass({
|
||||||
const parsedGroupId = this._parseGroupId(this.state.groupId);
|
const parsedGroupId = this._parseGroupId(this.state.groupId);
|
||||||
let error = null;
|
let error = null;
|
||||||
if (parsedGroupId === null) {
|
if (parsedGroupId === null) {
|
||||||
error = _t("Group IDs must be of the form +localpart:%(domain)s", {domain: MatrixClientPeg.get().getDomain()});
|
error = _t(
|
||||||
|
"Group IDs must be of the form +localpart:%(domain)s",
|
||||||
|
{domain: MatrixClientPeg.get().getDomain()},
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
const localpart = parsedGroupId[0];
|
|
||||||
const domain = parsedGroupId[1];
|
const domain = parsedGroupId[1];
|
||||||
if (domain !== MatrixClientPeg.get().getDomain()) {
|
if (domain !== MatrixClientPeg.get().getDomain()) {
|
||||||
error = _t(
|
error = _t(
|
||||||
"It is currently only possible to create groups on your own home server: use a group ID ending with %(domain)s",
|
"It is currently only possible to create groups on your own home server: "+
|
||||||
{domain: MatrixClientPeg.get().getDomain()}
|
"use a group ID ending with %(domain)s",
|
||||||
|
{domain: MatrixClientPeg.get().getDomain()},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,6 +116,9 @@ export default React.createClass({
|
||||||
* Parse a string that may be a group ID
|
* Parse a string that may be a group ID
|
||||||
* If the string is a valid group ID, return a list of [localpart, domain],
|
* If the string is a valid group ID, return a list of [localpart, domain],
|
||||||
* otherwise return null.
|
* otherwise return null.
|
||||||
|
*
|
||||||
|
* @param {string} groupId The ID of the group
|
||||||
|
* @return {string[]} array of localpart, domain
|
||||||
*/
|
*/
|
||||||
_parseGroupId: function(groupId) {
|
_parseGroupId: function(groupId) {
|
||||||
const matches = GROUP_REGEX.exec(this.state.groupId);
|
const matches = GROUP_REGEX.exec(this.state.groupId);
|
||||||
|
|
Loading…
Reference in a new issue