Skip to content

Commit

Permalink
feat: ensure projects are reload after deleting them all
Browse files Browse the repository at this point in the history
  • Loading branch information
pirhoo committed Aug 4, 2023
1 parent 36a9aef commit 082187e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/MountedDataLocation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand All @@ -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')
Expand Down

0 comments on commit 082187e

Please sign in to comment.