diff options
author | suntala <suntala@hotmail.com> | 2018-08-29 17:11:44 +0200 |
---|---|---|
committer | suntala <suntala@hotmail.com> | 2018-08-29 17:11:44 +0200 |
commit | e7362cddc418d0d25c121246b883fa7e3bff630a (patch) | |
tree | afd11dc8c12bc69c6f2576e2bfee0a507cb3272e | |
parent | 8f37d82bcf3f35f32c59c214b4361cf5b44390d7 (diff) |
Add address book name to import screen.
-rw-r--r-- | src/components/ImportScreen.vue | 2 | ||||
-rw-r--r-- | src/components/Settings/SettingsImportContacts.vue | 3 | ||||
-rw-r--r-- | src/store/addressbooks.js | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/components/ImportScreen.vue b/src/components/ImportScreen.vue index e0f3f827..bb903442 100644 --- a/src/components/ImportScreen.vue +++ b/src/components/ImportScreen.vue @@ -23,7 +23,7 @@ <template> <div class="emptycontent import-screen"> <p class="icon-upload" /> - <h3 class="import-screen__header">{{ t('contacts', 'Importing into') }} {{ addressbook }}</h3> + <h3 class="import-screen__header">{{ t('contacts', 'Importing into') }} {{ importState.addressbook }}</h3> <progress :max="importState.total" :value="importState.accepted" class="import-screen__progress" /> <p class="import-screen__tracker">{{ Math.floor(importState.accepted/(importState.total + 1)) * 100 }} %</p> </div> diff --git a/src/components/Settings/SettingsImportContacts.vue b/src/components/Settings/SettingsImportContacts.vue index b211fe6a..10fd4b62 100644 --- a/src/components/Settings/SettingsImportContacts.vue +++ b/src/components/Settings/SettingsImportContacts.vue @@ -89,9 +89,10 @@ export default { let reader = new FileReader() let selectedAddressbook = this.selectedAddressbook this.$store.dispatch('changeStage', 'parsing') + this.$store.dispatch('setAddressbook', selectedAddressbook.displayName) let self = this reader.onload = function(e) { - self.$store.dispatch('getContactsFromAddressBook', { vcf: reader.result, addressbook: selectedAddressbook, importState: this.importState }) + self.$store.dispatch('importContactsIntoAddressbook', { vcf: reader.result, addressbook: selectedAddressbook }) } reader.readAsText(file) } diff --git a/src/store/addressbooks.js b/src/store/addressbooks.js index 169dfc41..bbdff090 100644 --- a/src/store/addressbooks.js +++ b/src/store/addressbooks.js @@ -208,13 +208,13 @@ const actions = { */ importContactsIntoAddressbook(context, { vcf, addressbook }) { let contacts = parseVcf(vcf, addressbook) - this.$store.dispatch('changeStage', 'importing') + context.commit('changeStage', 'importing') contacts.forEach(contact => { context.commit('addContact', contact) context.commit('addContactToAddressbook', contact) context.commit('appendGroupsFromContacts', [contact]) }) - this.$store.dispatch('changeStage', 'default') + context.commit('changeStage', 'default') }, /** |