fix: related task not removed from the list when deleting it

This commit is contained in:
kolaente 2021-11-02 20:18:34 +01:00
parent edc74fd598
commit 21ddd25714
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 12 additions and 8 deletions

View File

@ -244,15 +244,19 @@ export default {
try {
await this.taskRelationService.delete(rel)
Object.entries(this.relatedTasks).some(([relationKind, t]) => {
const found = typeof this.relatedTasks[relationKind][t] !== 'undefined' &&
this.relatedTasks[relationKind][t].id === this.relationToDelete.otherTaskId &&
relationKind === this.relationToDelete.relationKind
if (!found) return false
outer:
for (const kind in this.relatedTasks) {
for (const t in this.relatedTasks[kind]) {
const found = typeof this.relatedTasks[kind][t] !== 'undefined' &&
this.relatedTasks[kind][t].id === this.relationToDelete.otherTaskId &&
kind === this.relationToDelete.relationKind
if (!found) continue
this.relatedTasks[relationKind].splice(t, 1)
return true
})
this.relatedTasks[kind].splice(t, 1)
break outer
}
}
this.saved = true
setTimeout(() => {