Skip to content

Commit

Permalink
tree-table: use effect to update not-shown accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
yagebu committed Jan 6, 2025
1 parent 3365454 commit e71d724
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions frontend/src/tree-table/IntervalTreeTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
const not_shown = writable(new Set<string>());
setTreeTableContext({ toggled, not_shown });
$not_shown = intersection(
...trees.map((n, index) => $get_not_shown(n, dates[index]?.end ?? null)),
);
$effect(() => {
$not_shown = intersection(
...trees.map((n, index) => $get_not_shown(n, dates[index]?.end ?? null)),
);
});
let account = $derived(trees[0].account);
let start_date = $derived(
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/tree-table/TreeTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
const not_shown = writable(new Set<string>());
setTreeTableContext({ toggled, not_shown });
$not_shown = $get_not_shown(tree, end);
$effect(() => {
$not_shown = $get_not_shown(tree, end);
});
</script>

<ol
Expand Down

0 comments on commit e71d724

Please sign in to comment.