diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-09-08 16:04:52 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-09-08 21:04:28 +0200 |
commit | 5bac2a13014c57328abd60bc519f56e41343beda (patch) | |
tree | 1e2fd112306ff0e2846ab84725f2ae8e6623781c /src/components/Settings | |
parent | b33920d2c61f77efb76dbafa38895e4c09c8c232 (diff) |
Fix import addressbook display name
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/components/Settings')
-rw-r--r-- | src/components/Settings/SettingsImportContacts.vue | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/components/Settings/SettingsImportContacts.vue b/src/components/Settings/SettingsImportContacts.vue index 73cc4cd6..18c49fbe 100644 --- a/src/components/Settings/SettingsImportContacts.vue +++ b/src/components/Settings/SettingsImportContacts.vue @@ -196,12 +196,14 @@ export default { const file = event.target.files[0] const reader = new FileReader() - const selectedAddressbook = this.selectedAddressbook + + const addressbook = this.selectedAddressbook + this.$store.dispatch('setAddressbook', addressbook.displayName) const self = this reader.onload = function(e) { self.isOpened = false - self.$store.dispatch('importContactsIntoAddressbook', { vcf: reader.result, addressbook: selectedAddressbook }) + self.$store.dispatch('importContactsIntoAddressbook', { vcf: reader.result, addressbook }) // reset input event.target.value = '' @@ -223,11 +225,12 @@ export default { cancelToken: source.token, }) + const addressbook = this.selectedAddressbook this.$store.dispatch('changeStage', 'parsing') - this.$store.dispatch('setAddressbook', this.selectedAddressbook.displayName) + this.$store.dispatch('setAddressbook', addressbook.displayName) if (file.data) { - await this.$store.dispatch('importContactsIntoAddressbook', { vcf: file.data, addressbook: this.selectedAddressbook }) + await this.$store.dispatch('importContactsIntoAddressbook', { vcf: file.data, addressbook }) } } catch (error) { console.error('Something wrong happened while processing local file', error) |