Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree-table: use effect to update not-shown accounts #1942

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading