dont use [...path] routing since it breaks building statically
This commit is contained in:
@@ -7,9 +7,24 @@ definePageMeta({
|
||||
middleware: ['authenticated'],
|
||||
});
|
||||
|
||||
const entries = useAsyncData('current-directory', () =>
|
||||
getWarrenDirectory(useWarrenRoute().value)
|
||||
).data;
|
||||
const warrenStore = useWarrenStore();
|
||||
|
||||
if (warrenStore.current == null) {
|
||||
await navigateTo({
|
||||
path: '/warrens',
|
||||
});
|
||||
}
|
||||
|
||||
const entries = useAsyncData('current-directory', async () => {
|
||||
if (warrenStore.current == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await getWarrenDirectory(
|
||||
warrenStore.current.warrenId,
|
||||
warrenStore.current.path
|
||||
);
|
||||
}).data;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -1,26 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||
import type { Warren } from '~/types/warrens';
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['authenticated'],
|
||||
});
|
||||
|
||||
const store = useWarrenStore();
|
||||
|
||||
function selectWarren(warren: Warren) {
|
||||
store.setCurrentWarren(warren.id, '/');
|
||||
navigateTo({
|
||||
path: '/warrens/files',
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ScrollArea class="h-full w-full">
|
||||
<div class="flex flex-row gap-2">
|
||||
<NuxtLink
|
||||
<Button
|
||||
v-for="(warren, uuid) in store.warrens"
|
||||
:key="uuid"
|
||||
:to="`/warrens/${uuid}`"
|
||||
class="h-12 w-44"
|
||||
variant="outline"
|
||||
size="lg"
|
||||
@click="() => selectWarren(warren)"
|
||||
>
|
||||
<Button class="h-12 w-44" variant="outline" size="lg">
|
||||
<Icon name="lucide:folder-root" />
|
||||
<span clas="truncate">{{ warren.name }}</span>
|
||||
</Button>
|
||||
</NuxtLink>
|
||||
<Icon name="lucide:folder-root" />
|
||||
<span clas="truncate">{{ warren.name }}</span>
|
||||
</Button>
|
||||
</div>
|
||||
</ScrollArea>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user