limit displayable accounts to 5

This commit is contained in:
Nicolas Constant 2018-09-30 20:45:20 -04:00
parent 11ae5cb42b
commit 3079a93574
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 12 additions and 5 deletions

View File

@ -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));
} }