diff --git a/src/base/orgs/Org.ts b/src/base/orgs/Org.ts index f0ab38fab..a0fd7ffbd 100644 --- a/src/base/orgs/Org.ts +++ b/src/base/orgs/Org.ts @@ -3,7 +3,6 @@ import type { TransactionResponse } from '@ethersproject/providers'; import type { ContractReceipt } from '@ethersproject/contracts'; import { OperationType } from "@gnosis.pm/safe-core-sdk-types"; -import { Profile, ProfileType } from '@app/profile'; import { assert } from '@app/error'; import * as utils from '@app/utils'; import type { Safe } from '@app/utils'; @@ -174,14 +173,6 @@ export class Org { return projects; } - async getProfile(profileType: ProfileType, config: Config): Promise { - return Org.getProfile(this.name ?? this.address, profileType, config); - } - - static async getProjectProfile(addrOrName: string, config: Config): Promise { - return Org.getProfile(addrOrName, ProfileType.Project, config); - } - static async getAnchor(orgAddr: string, urn: string, config: Config): Promise { const org = new ethers.Contract( orgAddr, @@ -264,26 +255,6 @@ export class Org { } } - // Return the org profile if there is one, otherwise try to get the profile - // of its owner. - static async getProfile(addressOrName: string, profileType: ProfileType, config: Config): Promise { - const profile = await Profile.get(addressOrName, profileType, config); - - if (profile.ens) { // Orgs only use ENS for profile information. - return profile; - } - const org = await Org.get(addressOrName, config); - - if (org) { - const ownerProfile = await Profile.get(org.owner, profileType, config); - - if (ownerProfile.ens || ownerProfile.idx) { - return ownerProfile; - } - } - return profile; - } - static async getOrgsByMember(owner: string, config: Config): Promise { type Safe = { id: string; owners: string[]; threshold: number }; diff --git a/src/base/orgs/View.svelte b/src/base/orgs/View.svelte index 8b0f3bb43..0d8f2199e 100644 --- a/src/base/orgs/View.svelte +++ b/src/base/orgs/View.svelte @@ -173,7 +173,7 @@ {:then org} {#if org}
- {#await org.getProfile(ProfileType.Full, config)} + {#await Profile.get(org.name ?? org.address, ProfileType.Full, config)}
diff --git a/src/base/projects/View.svelte b/src/base/projects/View.svelte index d64ad9824..355b667b5 100644 --- a/src/base/projects/View.svelte +++ b/src/base/projects/View.svelte @@ -5,7 +5,6 @@ import Loading from '@app/Loading.svelte'; import Modal from '@app/Modal.svelte'; import Avatar from '@app/Avatar.svelte'; - import { Org } from '@app/base/orgs/Org'; import { Profile, ProfileType } from '@app/profile'; import type { Info } from '@app/project'; import { formatOrg } from '@app/utils'; @@ -25,7 +24,7 @@ let projectRoot = proj.path({ urn, user, org, commit }); let getProject = new Promise(resolve => { if (org) { - Org.getProjectProfile(org, config).then(p => resolve(p)); + Profile.get(org, ProfileType.Project, config).then(p => resolve(p)); } else if (user) { Profile.get(user, ProfileType.Project, config).then(p => resolve(p)); } else { diff --git a/src/base/users/View.svelte b/src/base/users/View.svelte index 5920b8aa9..8f0afc5a2 100644 --- a/src/base/users/View.svelte +++ b/src/base/users/View.svelte @@ -146,7 +146,7 @@ {#if orgs.length > 0}
{#each orgs as org} - {#await Org.getProfile(org.address, ProfileType.Minimal, config)} + {#await Profile.get(org.address, ProfileType.Minimal, config)} {:then profile}