{#if activeLinkIndex !== -1}
{/if} {#each links as { name, url } (url)} { if (shouldGoBack) { const currentIndex = links.findIndex((i) => i.activeMatch($page.url.pathname), ); const nextIndex = links.findIndex((i) => i.activeMatch(url), ); $shouldGoBack = nextIndex < currentIndex; } }} >
{#key name} {name} {/key}
{/each}