From 082187ece97e5cfef720c656ff343dd52f52b323 Mon Sep 17 00:00:00 2001 From: Pierre Romera Date: Fri, 4 Aug 2023 10:17:45 +0000 Subject: [PATCH] feat: ensure projects are reload after deleting them all --- src/components/MountedDataLocation.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/MountedDataLocation.vue b/src/components/MountedDataLocation.vue index 3ba439fcfd..cd17b86c5f 100644 --- a/src/components/MountedDataLocation.vue +++ b/src/components/MountedDataLocation.vue @@ -60,16 +60,17 @@ export default { } }, methods: { - async deleteAll() { + async deleteAllProjects() { try { await this.$store.dispatch('indexing/deleteAll') - this.$root.$emit('index::delete::all') this.$bvToast.toast(this.$t('indexing.deleteSuccess'), { noCloseButton: true, variant: 'success' }) } catch (error) { if (error && error.response && error.response.status !== 404) { this.$bvToast.toast(this.$t('indexing.deleteFailure'), { noCloseButton: true, variant: 'danger' }) } } + }, + async deleteAllBatchSearches() { try { await this.$store.dispatch('batchSearch/deleteBatchSearches') this.$bvToast.toast(this.$t('indexing.deleteBatchSearchSuccess'), { noCloseButton: true, variant: 'success' }) @@ -79,6 +80,14 @@ export default { } } }, + async deleteAll() { + await this.deleteAllProjects() + await this.deleteAllBatchSearches() + await this.$core.createDefaultProject() + await this.$core.loadUser() + this.$store.commit('search/index', this.$config.get('defaultProject')) + this.$root.$emit('index::delete::all') + }, showTreeView() { this.$set(this, 'path', this.dataDir) this.$bvModal.show('mounting-data-location-tree-view')