mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-15 19:30:38 +08:00
Fetch tree only when it's expanded
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
@@ -16,9 +16,11 @@
|
||||
export let revision: string;
|
||||
|
||||
let expanded = currentPath.indexOf(prefix) === 0;
|
||||
let tree: Promise<Tree | undefined> = fetchTree(prefix).then(tree => {
|
||||
if (expanded) return tree;
|
||||
});
|
||||
let tree: Promise<Tree | undefined> = expanded
|
||||
? fetchTree(prefix).then(tree => {
|
||||
return tree;
|
||||
})
|
||||
: Promise.resolve(undefined);
|
||||
|
||||
const dispatch = createEventDispatcher<{ select: string }>();
|
||||
const onSelectFile = ({ detail: path }: { detail: string }) =>
|
||||
|
||||
Reference in New Issue
Block a user