feat: don't rethrow same error and handle errors globally
This commit is contained in:
@ -211,9 +211,6 @@ export default {
|
||||
|
||||
this.tasks = tasks
|
||||
})
|
||||
.catch(e => {
|
||||
this.$message.error(e)
|
||||
})
|
||||
},
|
||||
updateTasks(updatedTask) {
|
||||
for (const t in this.tasks) {
|
||||
|
@ -574,9 +574,6 @@ export default {
|
||||
this.setActiveFields()
|
||||
this.setTitle(this.task.title)
|
||||
})
|
||||
.catch(e => {
|
||||
this.$message.error(e)
|
||||
})
|
||||
.finally(() => {
|
||||
this.$nextTick(() => this.visible = true)
|
||||
this.scrollToHeading()
|
||||
@ -620,25 +617,21 @@ export default {
|
||||
this.task.endDate = this.task.dueDate
|
||||
}
|
||||
|
||||
try {
|
||||
this.task = await this.$store.dispatch('tasks/update', this.task)
|
||||
this.setActiveFields()
|
||||
this.task = await this.$store.dispatch('tasks/update', this.task)
|
||||
this.setActiveFields()
|
||||
|
||||
if (!showNotification) {
|
||||
return
|
||||
}
|
||||
|
||||
let actions = []
|
||||
if (undoCallback !== null) {
|
||||
actions = [{
|
||||
title: 'Undo',
|
||||
callback: undoCallback,
|
||||
}]
|
||||
}
|
||||
this.$message.success({message: this.$t('task.detail.updateSuccess')}, actions)
|
||||
} catch(e) {
|
||||
this.$message.error(e)
|
||||
if (!showNotification) {
|
||||
return
|
||||
}
|
||||
|
||||
let actions = []
|
||||
if (undoCallback !== null) {
|
||||
actions = [{
|
||||
title: 'Undo',
|
||||
callback: undoCallback,
|
||||
}]
|
||||
}
|
||||
this.$message.success({message: this.$t('task.detail.updateSuccess')}, actions)
|
||||
},
|
||||
setFieldActive(fieldName) {
|
||||
this.activeFields[fieldName] = true
|
||||
@ -664,9 +657,6 @@ export default {
|
||||
this.$message.success({message: this.$t('task.detail.deleteSuccess')})
|
||||
this.$router.push({name: 'list.index', params: {listId: this.task.listId}})
|
||||
})
|
||||
.catch(e => {
|
||||
this.$message.error(e)
|
||||
})
|
||||
},
|
||||
toggleTaskDone() {
|
||||
this.task.done = !this.task.done
|
||||
@ -705,9 +695,6 @@ export default {
|
||||
this.task = t
|
||||
this.$store.dispatch('namespaces/loadNamespacesIfFavoritesDontExist')
|
||||
})
|
||||
.catch(e => {
|
||||
this.$message.error(e)
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user