mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-09 13:40:28 +08:00
Fix loading indicator bug
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
// component, eg. when using the browser's "back" button.
|
||||
$: getBlob = loadBlob(path);
|
||||
$: getAnchor = org ? Org.getAnchor(org, urn, config) : null;
|
||||
$: loading = state.status == Status.Loading ? state.path : null;
|
||||
$: loadingPath = state.status == Status.Loading ? state.path : null;
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@@ -210,7 +210,7 @@
|
||||
{#if tree.entries.length}
|
||||
<div class="column-left">
|
||||
<div class="source-tree">
|
||||
<Tree {tree} {path} {fetchTree} {loading} on:select={onSelect} />
|
||||
<Tree {tree} {path} {fetchTree} {loadingPath} on:select={onSelect} />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column-right">
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
export let fetchTree: (path: string) => Promise<Tree>;
|
||||
export let path: string;
|
||||
export let tree: Tree;
|
||||
export let loading: string | null = null;
|
||||
export let loadingPath: string | null = null;
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
const onSelect = ({ detail: path }: { detail: string }): void => {
|
||||
@@ -22,7 +22,7 @@
|
||||
{#if entry.info.objectType === ObjectType.Tree}
|
||||
<Folder
|
||||
{fetchTree}
|
||||
{loading}
|
||||
{loadingPath}
|
||||
name={entry.info.name}
|
||||
prefix={`${entry.path}/`}
|
||||
currentPath={path}
|
||||
@@ -31,7 +31,7 @@
|
||||
{:else}
|
||||
<File
|
||||
active={entry.path === path}
|
||||
loading={entry.path === loading}
|
||||
loading={entry.path === loadingPath}
|
||||
name={entry.info.name}
|
||||
on:click={() => onSelect({ detail: entry.path })}
|
||||
/>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
export let name: string;
|
||||
export let prefix: string;
|
||||
export let currentPath: string;
|
||||
export let loading: string | null = null;
|
||||
export let loadingPath: string | null = null;
|
||||
|
||||
let expanded = currentPath.indexOf(prefix) === 0;
|
||||
let tree: Promise<Tree> | null = expanded ? fetchTree(prefix) : null;
|
||||
@@ -78,11 +78,12 @@
|
||||
name={entry.info.name}
|
||||
on:select={onSelectFile}
|
||||
prefix={`${entry.path}/`}
|
||||
{loadingPath}
|
||||
{currentPath} />
|
||||
{:else}
|
||||
<File
|
||||
active={entry.path === currentPath}
|
||||
loading={entry.path === loading}
|
||||
loading={entry.path === loadingPath}
|
||||
name={entry.info.name}
|
||||
on:click={() => {
|
||||
onSelectFile({ detail: entry.path });
|
||||
|
||||
Reference in New Issue
Block a user