fix sidebar warren buttons

This commit is contained in:
2025-07-18 11:07:56 +02:00
parent ecb201dc69
commit 026f84b870

View File

@@ -15,6 +15,13 @@ import {
const route = useRoute();
const store = useWarrenStore();
async function selectWarren(id: string) {
await store.setCurrentWarren(id, '/');
await navigateTo({
path: '/warrens/files',
});
}
</script>
<template>
@@ -46,25 +53,20 @@ const store = useWarrenStore();
<CollapsibleContent>
<SidebarMenuSub>
<SidebarMenuSubItem
v-for="(warren, uuid) in store.warrens"
:key="uuid"
v-for="(warren, id) in store.warrens"
:key="id"
>
<SidebarMenuSubButton
as-child
:tooltip="warren.name"
:is-active="
route.path.startsWith(
`/warrens/${uuid}`
)
store.current != null &&
store.current.warrenId === id
"
class="transition-all"
@click="() => selectWarren(id)"
>
<NuxtLink :to="`/warrens/${uuid}`">
<Icon
name="lucide:folder-root"
/>
<Icon name="lucide:folder-root" />
<span>{{ warren.name }}</span>
</NuxtLink>
</SidebarMenuSubButton>
</SidebarMenuSubItem>
</SidebarMenuSub>