diff options
author | hamza221 <hamzamahjoubi221@gmail.com> | 2023-07-19 20:09:43 +0200 |
---|---|---|
committer | hamza221 <hamzamahjoubi221@gmail.com> | 2023-07-19 20:20:49 +0200 |
commit | 0b27f1aec417d3cd2463647c2f25a131da78ace2 (patch) | |
tree | 3f9c89742e8d601df1ab64960afa9e92b643ffef | |
parent | b29b6bbaa0b64bffa475369113fc3681822ab07a (diff) |
fix import loads forever
Signed-off-by: hamza221 <hamzamahjoubi221@gmail.com>
-rw-r--r-- | src/components/AppNavigation/Settings/SettingsImportContacts.vue | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/components/AppNavigation/Settings/SettingsImportContacts.vue b/src/components/AppNavigation/Settings/SettingsImportContacts.vue index 130e7a64..5c4486e5 100644 --- a/src/components/AppNavigation/Settings/SettingsImportContacts.vue +++ b/src/components/AppNavigation/Settings/SettingsImportContacts.vue @@ -73,8 +73,7 @@ <IconLoading v-if="loading" :size="20" /> <IconFolder :size="20" /> </template> - <span class="import-contact__button-icon" /> - {{ t('contacts', 'Import from Files') }} + {{ t('contacts', 'Import from files') }} </Button> </section> </Modal> @@ -274,17 +273,20 @@ export default { */ async openPicker() { try { - this.loading = true // unlikely, but let's cancel any previous request this.cancelRequest() // pick, retrieve & process file const path = await picker.pick() - await this.processLocalFile(path) + if (path) { + this.loading = true + await this.processLocalFile(path) + } + this.resetState() + } catch (error) { + this.loading = false console.error('Something wrong happened while picking a file', error) - } finally { - this.resetState() } }, |