recursively get file size for directories

This commit is contained in:
2025-09-06 16:23:42 +02:00
parent 3329860b02
commit e1e97ef79d
4 changed files with 32 additions and 14 deletions

View File

@@ -1,9 +1,9 @@
export function useWarrenPath() {
export function useWarrenPath(): { warrenId: string; path: string } | null {
const store = useWarrenStore();
if (store.current == null) {
return null;
}
return `${store.current.warrenId}${store.current.path}`;
return { warrenId: store.current.warrenId, path: store.current.path };
}

View File

@@ -38,6 +38,7 @@ export async function getWarrenDirectory(
warrenId,
path,
}),
key: `${warrenId}-${path}`,
});
if (data.value == null) {

View File

@@ -36,7 +36,7 @@ if (warrenStore.current == null) {
useAsyncData(
'current-directory',
async () => {
if (warrenStore.current == null) {
if (warrenPath.value == null) {
return {
files: [],
parent: null,
@@ -47,8 +47,8 @@ useAsyncData(
warrenStore.loading = true;
const { files, parent } = await getWarrenDirectory(
warrenStore.current.warrenId,
warrenStore.current.path
warrenPath.value.warrenId,
warrenPath.value.path
);
warrenStore.loading = false;