show "loading" while loading parent candidates
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
let { project, select = o => {}, task } = $props();
|
||||
let tree = $state({});
|
||||
let loading = $state(true);
|
||||
|
||||
async function loadParentCandidates(){
|
||||
let url = api(`task/${task.id}/parent_candidates`);
|
||||
@@ -14,6 +15,7 @@
|
||||
if (res.ok){
|
||||
yikes();
|
||||
tree = await res.json();
|
||||
loading = false;
|
||||
} else error(res);
|
||||
}
|
||||
|
||||
@@ -26,5 +28,11 @@
|
||||
<button onclick={ev => select(null)}>{t('abort')}</button>
|
||||
</h2>
|
||||
{t('project')}: {project.name}
|
||||
{#if loading}
|
||||
<p>
|
||||
{t('loading')}
|
||||
</p>
|
||||
{:else}
|
||||
<TaskTree {tree} {select} />
|
||||
{/if}
|
||||
</div>
|
||||
Reference in New Issue
Block a user