don't autosuggest when same element
This commit is contained in:
parent
aa6b93eebb
commit
f019b8d68b
|
@ -73,14 +73,16 @@ export class AutosuggestComponent implements OnInit, OnDestroy {
|
|||
|
||||
if (isAccount) {
|
||||
for (let account of results.accounts) {
|
||||
this.accounts.push(new SelectableAccount(account));
|
||||
this.accounts[0].selected = true;
|
||||
if (this.accounts.length > 7) return;
|
||||
if (account.acct != this.lastPatternUsed) {
|
||||
this.accounts.push(new SelectableAccount(account));
|
||||
this.accounts[0].selected = true;
|
||||
if (this.accounts.length > 7) return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (let hashtag of results.hashtags) {
|
||||
if (hashtag.includes(this.lastPatternUsed) || hashtag === this.lastPatternUsed) {
|
||||
if (hashtag.includes(this.lastPatternUsed) && hashtag !== this.lastPatternUsed) {
|
||||
this.hashtags.push(new SelectableHashtag(hashtag));
|
||||
this.hashtags[0].selected = true;
|
||||
if (this.hashtags.length > 7) return;
|
||||
|
|
Loading…
Reference in New Issue