From 42ac987d961441c0413c47d384373476cc8cc833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 24 Oct 2018 10:50:27 +0200 Subject: Fix enable ab toggle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- src/views/Contacts.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/views') diff --git a/src/views/Contacts.vue b/src/views/Contacts.vue index a769f209..67a7fa39 100644 --- a/src/views/Contacts.vue +++ b/src/views/Contacts.vue @@ -282,13 +282,14 @@ export default { */ fetchContacts() { // wait for all addressbooks to have fetch their contacts - Promise.all(this.addressbooks.map(addressbook => this.$store.dispatch('getContactsFromAddressBook', { addressbook }))) - .then(results => { - this.loading = false - this.selectFirstContactIfNone() - }) - // no need for a catch, the action does not throw - // and the error is handled there + Promise.all(this.addressbooks.map(addressbook => { + if (addressbook.enabled) { + return this.$store.dispatch('getContactsFromAddressBook', { addressbook }) + } + })).then(results => { + this.loading = false + this.selectFirstContactIfNone() + }) }, /** -- cgit v1.2.3