mirror of https://github.com/nextcloud/contacts
Create addressbook if list empty
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
01917595a2
commit
42d7a88f4d
|
@ -7,6 +7,14 @@ angular.module('contactsApp')
|
|||
AddressBookService.getAll().then(function(addressBooks) {
|
||||
ctrl.addressBooks = addressBooks;
|
||||
ctrl.loading = false;
|
||||
if(ctrl.addressBooks.length === 0) {
|
||||
AddressBookService.create(t('contacts', 'Contacts')).then(function() {
|
||||
AddressBookService.getAddressBook(t('contacts', 'Contacts')).then(function(addressBook) {
|
||||
ctrl.addressBooks.push(addressBook);
|
||||
$scope.$apply();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
ctrl.t = {
|
||||
|
|
Loading…
Reference in New Issue