MOBILE-1501 participants: Select first when search or clear

main
Dani Palou 2019-12-03 15:08:35 +01:00
parent 2ceb3a155d
commit 3f842b8483
1 changed files with 11 additions and 1 deletions

View File

@ -165,7 +165,12 @@ export class CoreUserParticipantsComponent implements OnInit {
// Remove search results and display all participants. // Remove search results and display all participants.
this.participantsLoaded = false; this.participantsLoaded = false;
this.fetchData(true); this.fetchData(true).then(() => {
if (this.splitviewCtrl.isOn() && this.participants.length > 0) {
// Take first and load it.
this.gotoParticipant(this.participants[0].id);
}
});
} }
/** /**
@ -196,6 +201,11 @@ export class CoreUserParticipantsComponent implements OnInit {
this.canLoadMore = result.canLoadMore; this.canLoadMore = result.canLoadMore;
this.searchPage++; this.searchPage++;
if (!loadMore && this.splitviewCtrl.isOn() && this.participants.length > 0) {
// Take first and load it.
this.gotoParticipant(this.participants[0].id);
}
}).catch((error) => { }).catch((error) => {
this.domUtils.showErrorModalDefault(error, 'Error searching users.'); this.domUtils.showErrorModalDefault(error, 'Error searching users.');
this.loadMoreError = true; this.loadMoreError = true;