autocomplete domains on aliases
This commit is contained in:
parent
1aa85c69e4
commit
e9806bb147
1 changed files with 2 additions and 0 deletions
|
@ -147,6 +147,7 @@ module.exports = React.createClass({
|
||||||
if (!alias || alias.length === 0) return; // ignore attempts to create blank aliases
|
if (!alias || alias.length === 0) return; // ignore attempts to create blank aliases
|
||||||
|
|
||||||
const localDomain = MatrixClientPeg.get().getDomain();
|
const localDomain = MatrixClientPeg.get().getDomain();
|
||||||
|
if (!alias.includes(':')) alias += ':' + localDomain;
|
||||||
if (this.isAliasValid(alias) && alias.endsWith(localDomain)) {
|
if (this.isAliasValid(alias) && alias.endsWith(localDomain)) {
|
||||||
this.state.domainToAliases[localDomain] = this.state.domainToAliases[localDomain] || [];
|
this.state.domainToAliases[localDomain] = this.state.domainToAliases[localDomain] || [];
|
||||||
this.state.domainToAliases[localDomain].push(alias);
|
this.state.domainToAliases[localDomain].push(alias);
|
||||||
|
@ -174,6 +175,7 @@ module.exports = React.createClass({
|
||||||
onLocalAliasChanged: function(alias, index) {
|
onLocalAliasChanged: function(alias, index) {
|
||||||
if (alias === "") return; // hit the delete button to delete please
|
if (alias === "") return; // hit the delete button to delete please
|
||||||
const localDomain = MatrixClientPeg.get().getDomain();
|
const localDomain = MatrixClientPeg.get().getDomain();
|
||||||
|
if (!alias.includes(':')) alias += ':' + localDomain;
|
||||||
if (this.isAliasValid(alias) && alias.endsWith(localDomain)) {
|
if (this.isAliasValid(alias) && alias.endsWith(localDomain)) {
|
||||||
this.state.domainToAliases[localDomain][index] = alias;
|
this.state.domainToAliases[localDomain][index] = alias;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue