mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
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
|
||||
|
||||
const localDomain = MatrixClientPeg.get().getDomain();
|
||||
if (!alias.includes(':')) alias += ':' + localDomain;
|
||||
if (this.isAliasValid(alias) && alias.endsWith(localDomain)) {
|
||||
this.state.domainToAliases[localDomain] = this.state.domainToAliases[localDomain] || [];
|
||||
this.state.domainToAliases[localDomain].push(alias);
|
||||
|
@ -174,6 +175,7 @@ module.exports = React.createClass({
|
|||
onLocalAliasChanged: function(alias, index) {
|
||||
if (alias === "") return; // hit the delete button to delete please
|
||||
const localDomain = MatrixClientPeg.get().getDomain();
|
||||
if (!alias.includes(':')) alias += ':' + localDomain;
|
||||
if (this.isAliasValid(alias) && alias.endsWith(localDomain)) {
|
||||
this.state.domainToAliases[localDomain][index] = alias;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue