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 {
|
try {
|
||||||
await this.taskRelationService.delete(rel)
|
await this.taskRelationService.delete(rel)
|
||||||
|
|
||||||
outer:
|
const kind = this.relationToDelete.relationKind
|
||||||
for (const kind in this.relatedTasks) {
|
for (const t in this.relatedTasks[kind]) {
|
||||||
for (const t in this.relatedTasks[kind]) {
|
if (this.relatedTasks[kind][t].id === this.relationToDelete.otherTaskId) {
|
||||||
const found = typeof this.relatedTasks[kind][t] !== 'undefined' &&
|
this.relatedTasks[kind].splice(t, 1)
|
||||||
this.relatedTasks[kind][t].id === this.relationToDelete.otherTaskId &&
|
|
||||||
kind === this.relationToDelete.relationKind
|
|
||||||
if (!found) continue
|
|
||||||
|
|
||||||
this.relatedTasks[kind].splice(t, 1)
|
break
|
||||||
|
|
||||||
break outer
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.saved = true
|
this.saved = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -364,7 +359,7 @@ $remove-icon-width: 24px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover .tasks .task .remove {
|
&:hover .tasks .task .remove {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user