mirror of https://github.com/nextcloud/contacts
Fix error loading page when no contacts
This commit is contained in:
parent
e01603c4f5
commit
f4602b37c1
|
@ -69,9 +69,13 @@ angular.module('contactsApp')
|
|||
|
||||
// Get contacts
|
||||
ContactService.getAll().then(function(contacts) {
|
||||
$scope.$apply(function() {
|
||||
ctrl.contacts = contacts;
|
||||
});
|
||||
if(contacts.length>0) {
|
||||
$scope.$apply(function() {
|
||||
ctrl.contacts = contacts;
|
||||
});
|
||||
} else {
|
||||
ctrl.loading = false;
|
||||
}
|
||||
});
|
||||
|
||||
// Wait for ctrl.contactList to be updated, load the first contact and kill the watch
|
||||
|
|
Loading…
Reference in New Issue