From 24aa0d5f806c394385b7d6175644cadfb00d34bb Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Fri, 29 Oct 2021 10:02:27 +0200 Subject: [PATCH] Anchor is not clickable if already at head Signed-off-by: Alexis Sellier --- src/base/projects/Browser.svelte | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/base/projects/Browser.svelte b/src/base/projects/Browser.svelte index f58257d7d..ac5bcd6f4 100644 --- a/src/base/projects/Browser.svelte +++ b/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 @@ {:then anchor} {#if anchor === commit} - navigateBrowser(project.head)}> - anchored 🔒 - + {#if commit === project.head} + + anchored 🔒 + + {:else} + navigateBrowser(project.head)}> + anchored 🔒 + + {/if} {:else if anchor} navigateBrowser(anchor)}> not anchored 🔓