Don't query seed if no seed configured

Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Alexis Sellier
2022-02-09 12:22:46 +01:00
parent e55be482b1
commit 3fcbffe307
+26 -24
View File
@@ -55,29 +55,31 @@
</style>
<div class="projects">
{#await Seed.getProjects(config)}
<Loading center />
{:then projects}
{#each projects as project}
{@const anchor = anchors[project.urn]}
{@const pendingAnchor = pendingAnchors[project.urn]}
<div class="project">
<Widget {project} {anchor} on:click={() => onClick(project)}>
<span class="actions" slot="actions">
{#if profile.org?.safe && account && anchor}
{#if pendingAnchor} <!-- Pending anchor -->
<AnchorActions
{account} {config} anchor={pendingAnchor} safe={profile.org.safe}
on:success={() => loadAnchors()} />
{#if config.seed.api.host}
{#await Seed.getProjects(config)}
<Loading center />
{:then projects}
{#each projects as project}
{@const anchor = anchors[project.urn]}
{@const pendingAnchor = pendingAnchors[project.urn]}
<div class="project">
<Widget {project} {anchor} on:click={() => onClick(project)}>
<span class="actions" slot="actions">
{#if profile.org?.safe && account && anchor}
{#if pendingAnchor} <!-- Pending anchor -->
<AnchorActions
{account} {config} anchor={pendingAnchor} safe={profile.org.safe}
on:success={() => loadAnchors()} />
{/if}
{/if}
{/if}
</span>
</Widget>
</div>
{/each}
{:catch err}
<Message error>
<strong>Error: </strong> failed to load projects: {err.message}.
</Message>
{/await}
</span>
</Widget>
</div>
{/each}
{:catch err}
<Message error>
<strong>Error: </strong> failed to load projects: {err.message}.
</Message>
{/await}
{/if}
</div>