recursively get file size for directories
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ export async function getWarrenDirectory(
|
||||
warrenId,
|
||||
path,
|
||||
}),
|
||||
key: `${warrenId}-${path}`,
|
||||
});
|
||||
|
||||
if (data.value == null) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user