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

View File

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