working on project tree update upon task creation/deletion/update
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
let {
|
||||
estimated_time,
|
||||
lastEvent,
|
||||
show_closed,
|
||||
siblings,
|
||||
states = {},
|
||||
@@ -141,6 +142,18 @@
|
||||
estimated_time.sum += task.estimated_time;
|
||||
}
|
||||
|
||||
$effect(() => {
|
||||
if (lastEvent && lastEvent.task) {
|
||||
if (children && lastEvent.task.parent_task_id == task.id) {
|
||||
if (lastEvent.event == 'delete'){
|
||||
delete children[lastEvent.task.id];
|
||||
} else {
|
||||
children[lastEvent.task.id] = lastEvent.task;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
onMount(loadChildren);
|
||||
</script>
|
||||
|
||||
@@ -170,7 +183,7 @@
|
||||
<button class="symbol" title={t('add_object',{object:t('subtask')})} onclick={addSubtask}></button>
|
||||
<button class="symbol" title={t('timetracking')} onclick={addTime}></button>
|
||||
{#if children}
|
||||
<TaskList {states} tasks={children} {estimated_time} {show_closed} />
|
||||
<TaskList {states} {lastEvent} tasks={children} {estimated_time} {show_closed} />
|
||||
{/if}
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user