limit displayable accounts to 5
This commit is contained in:
parent
11ae5cb42b
commit
3079a93574
|
@ -45,10 +45,17 @@ export class SearchComponent implements OnInit {
|
||||||
const candid_oneAccount = enabledAccounts[0];
|
const candid_oneAccount = enabledAccounts[0];
|
||||||
this.mastodonService.search(candid_oneAccount, data)
|
this.mastodonService.search(candid_oneAccount, data)
|
||||||
.then((results: Results) => {
|
.then((results: Results) => {
|
||||||
|
if (results) {
|
||||||
console.warn(results);
|
console.warn(results);
|
||||||
this.accounts = results.accounts;
|
this.accounts = results.accounts;
|
||||||
this.statuses = results.statuses;
|
//this.statuses = results.statuses;
|
||||||
this.hashtags = results.hashtags;
|
this.hashtags = results.hashtags;
|
||||||
|
|
||||||
|
//TODO: Pleroma return more than mastodon, will have to handle that
|
||||||
|
if (this.accounts.length > 5) {
|
||||||
|
this.accounts.length = 5;
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => console.error(err));
|
.catch((err) => console.error(err));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue