mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-03 02:30:29 +08:00
Fix parent link in project view
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
import { Org } from '@app/base/orgs/Org';
|
||||
import type { Profile } from '@app/profile';
|
||||
import type { Info } from '@app/project';
|
||||
import { formatOrg } from '@app/utils';
|
||||
import { formatOrg, isAddressEqual } from '@app/utils';
|
||||
|
||||
import Browser from './Browser.svelte';
|
||||
|
||||
@@ -38,6 +38,12 @@
|
||||
return { project: info, config: cfg, org: orgProfile };
|
||||
});
|
||||
|
||||
const parentUrl = (profile: Profile) => {
|
||||
return org === profile.name || isAddressEqual(org, profile.address)
|
||||
? `/orgs/${profile.nameOrAddress}`
|
||||
: `/users/${profile.nameOrAddress}`;
|
||||
};
|
||||
|
||||
$: if (projectInfo) {
|
||||
if (projectInfo.meta.description) {
|
||||
pageTitle = `${formatOrg(org, config)}/${projectInfo.meta.name}: ${projectInfo.meta.description}`;
|
||||
@@ -106,7 +112,7 @@
|
||||
<header>
|
||||
<div class="title bold">
|
||||
{#if result.org}
|
||||
<a class="org-avatar" title={result.org.nameOrAddress} href={`/orgs/${result.org.nameOrAddress}`}>
|
||||
<a class="org-avatar" title={result.org.nameOrAddress} href={parentUrl(result.org)}>
|
||||
<Avatar source={result.org.avatar || result.org.address} address={result.org.address}/>
|
||||
</a>
|
||||
<span class="divider">/</span>
|
||||
|
||||
Reference in New Issue
Block a user