Skip to content

Commit

Permalink
Load first contact on initial load.
Browse files Browse the repository at this point in the history
  • Loading branch information
irgendwie committed Mar 19, 2016
1 parent 94c3b34 commit 5778c3b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/components/contactList/contactList_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ app.controller('contactlistCtrl', function($scope, $filter, $route, $routeParams
ContactService.getAll().then(function(contacts) {
$scope.$apply(function() {
ctrl.contacts = contacts;
if (!_.isEmpty(ctrl.contacts)) {
ctrl.setSelectedId(_.sortBy(contacts, function(contact) {
return contact.uid();
})[0].uid());
}
ctrl.loading = false;
});
});
Expand Down

0 comments on commit 5778c3b

Please sign in to comment.