diff --git a/src/base/orgs/View/Projects.svelte b/src/base/orgs/View/Projects.svelte index 0e072bd63..bf85d67fe 100644 --- a/src/base/orgs/View/Projects.svelte +++ b/src/base/orgs/View/Projects.svelte @@ -11,29 +11,32 @@ import type { Seed } from "@app/base/seeds/Seed"; import AnchorActions from "@app/base/profiles/AnchorActions.svelte"; - export let profile: Profile; - export let config: Config; export let seed: Seed; - export let account: string | null; + export let profile: Profile | null = null; + export let account: string | null = null; + export let config: Config; let anchors: Record = {}; let pendingAnchors: Record = {}; const loadAnchors = async () => { - const [pending, confirmed] = await Promise.all([ - profile.pendingAnchors(config), - profile.confirmedAnchors(config), - ]); + if (profile) { + const [pending, confirmed] = await Promise.all([ + profile.pendingAnchors(config), + profile.confirmedAnchors(config), + ]); - anchors = confirmed; - pendingAnchors = pending; + anchors = confirmed; + pendingAnchors = pending; + } }; const onClick = (project: ProjectInfo) => { navigate( proj.path({ urn: project.urn, - addressOrName: profile.name ?? profile.address, + seed: seed?.host, + addressOrName: profile?.name ?? profile?.address, revision: project.head, }) ); @@ -65,7 +68,7 @@
onClick(project)}> - {#if profile.org?.safe && account && anchor} + {#if profile?.org?.safe && account && anchor} {#if pendingAnchor} - import { navigate } from "svelte-routing"; import type { Config } from "@app/config"; import { Seed } from "@app/base/seeds/Seed"; - import Widget from "@app/base/projects/Widget.svelte"; import Loading from "@app/Loading.svelte"; import SeedAddress from "@app/SeedAddress.svelte"; import NotFound from "@app/NotFound.svelte"; - import * as proj from "@app/project"; + import Projects from "@app/base/orgs/View/Projects.svelte"; export let config: Config; export let host: string; - const onProjectClick = (project: proj.ProjectInfo) => { - navigate(proj.path({ - urn: project.urn, - seed: host, - })); - };