Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Fix parent link in project view
Alexis Sellier committed 4 years ago
commit 08d7ee6a2944f81753c3473f4d94f8730bfa50dd
parent 398f5c8d09dd5203ffc40ed4b2adf4bc8df45d4c
1 file changed +8 -2
modified src/base/projects/View.svelte
@@ -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>