mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore: use writable derived in more places (#17248)
chore(web): use writable derived in more places
This commit is contained in:
parent
d613f15606
commit
b25914c2a5
7 changed files with 14 additions and 37 deletions
|
|
@ -16,14 +16,11 @@
|
|||
|
||||
let { tree, parent, value, active = '', icons, getLink, getColor }: Props = $props();
|
||||
|
||||
let path = $derived(normalizeTreePath(`${parent}/${value}`));
|
||||
let isActive = $derived(active === path || active.startsWith(`${path}/`));
|
||||
let isOpen = $state(false);
|
||||
$effect(() => {
|
||||
isOpen = isActive;
|
||||
});
|
||||
let isTarget = $derived(active === path);
|
||||
let color = $derived(getColor(path));
|
||||
const path = $derived(normalizeTreePath(`${parent}/${value}`));
|
||||
const isActive = $derived(active === path || active.startsWith(`${path}/`));
|
||||
const isTarget = $derived(active === path);
|
||||
const color = $derived(getColor(path));
|
||||
let isOpen = $derived(isActive);
|
||||
|
||||
const onclick = (event: MouseEvent) => {
|
||||
event.preventDefault();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue