Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Anchor is not clickable if already at head
Alexis Sellier committed 4 years ago
commit 24aa0d5f806c394385b7d6175644cadfb00d34bb
parent 2c3f6c3238de97f2e4f5c19e79123869fdedb538
1 file changed +13 -3
modified src/base/projects/Browser.svelte
@@ -65,6 +65,7 @@
  const navigateBrowser = (commit: string, path?: string) => {
    // Replaces path with current path if none passed.
    if (path === undefined) path = state.path;
+

    if (org) {
      navigate(proj.path({ urn, org, commit, path }));
    } else if (user) {
@@ -135,6 +136,9 @@
  .anchor-label:last-child {
    margin-right: 0;
  }
+
  .anchor-latest {
+
    cursor: default;
+
  }

  .seed {
    cursor: pointer;
@@ -265,9 +269,15 @@
            <Loading small margins />
          {:then anchor}
            {#if anchor === commit}
-
              <span class="anchor-widget" on:click={() => navigateBrowser(project.head)}>
-
                <span class="anchor-label" title="{anchors}">anchored 🔒</span>
-
              </span>
+
              {#if commit === project.head}
+
                <span class="anchor-widget anchor-latest">
+
                  <span class="anchor-label" title="{anchors}">anchored 🔒</span>
+
                </span>
+
              {:else}
+
                <span class="anchor-widget" on:click={() => navigateBrowser(project.head)}>
+
                  <span class="anchor-label" title="{anchors}">anchored 🔒</span>
+
                </span>
+
              {/if}
            {:else if anchor}
              <span class="anchor-widget not-anchored" on:click={() => navigateBrowser(anchor)}>
                <span class="anchor-label">not anchored 🔓</span>