chore: refactor removing a related task

This commit is contained in:
kolaente 2021-11-03 21:53:27 +01:00
parent ce5de84c84
commit 2f28b43243
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 7 additions and 12 deletions

View File

@ -242,19 +242,14 @@ export default {
try {
await this.taskRelationService.delete(rel)
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
const kind = this.relationToDelete.relationKind
for (const t in this.relatedTasks[kind]) {
if (this.relatedTasks[kind][t].id === this.relationToDelete.otherTaskId) {
this.relatedTasks[kind].splice(t, 1)
this.relatedTasks[kind].splice(t, 1)
break outer
}
break
}
}
this.saved = true
setTimeout(() => {
@ -364,7 +359,7 @@ $remove-icon-width: 24px;
}
}
}
&:hover .tasks .task .remove {
opacity: 1;
}