forked from vikunja/frontend
chore: refactor removing a related task
This commit is contained in:
parent
ce5de84c84
commit
2f28b43243
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user