Skip to content

Commit 9f510b1

Browse files
authored
fix: do not show back button when there is no history (#1133)
1 parent f13279e commit 9f510b1

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

app/pages/about.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const { data: contributors, status: contributorsStatus } = useFetch<GitHubContri
5353
type="button"
5454
class="inline-flex items-center gap-2 font-mono text-sm text-fg-muted hover:text-fg transition-colors duration-200 rounded focus-visible:outline-accent/70 shrink-0"
5555
@click="router.back()"
56+
v-show="router.options.history.state.back !== null"
5657
>
5758
<span class="i-carbon:arrow-left rtl-flip w-4 h-4" aria-hidden="true" />
5859
<span class="hidden sm:inline">{{ $t('nav.back') }}</span>

app/pages/compare.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ useSeoMeta({
118118
type="button"
119119
class="inline-flex items-center gap-2 font-mono text-sm text-fg-muted hover:text-fg transition-colors duration-200 rounded focus-visible:outline-accent/70 shrink-0"
120120
@click="router.back()"
121+
v-show="router.options.history.state.back !== null"
121122
>
122123
<span class="i-carbon:arrow-left rtl-flip w-4 h-4" aria-hidden="true" />
123124
<span class="hidden sm:inline">{{ $t('nav.back') }}</span>

app/pages/privacy.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const { locale } = useI18n()
3030
type="button"
3131
class="inline-flex items-center gap-2 font-mono text-sm text-fg-muted hover:text-fg transition-colors duration-200 rounded focus-visible:outline-accent/70 shrink-0"
3232
@click="router.back()"
33+
v-show="router.options.history.state.back !== null"
3334
>
3435
<span class="i-carbon:arrow-left rtl-flip w-4 h-4" aria-hidden="true" />
3536
<span class="sr-only sm:not-sr-only">{{ $t('nav.back') }}</span>

app/pages/settings.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const setLocale: typeof setNuxti18nLocale = locale => {
5252
type="button"
5353
class="inline-flex items-center gap-2 font-mono text-sm text-fg-muted hover:text-fg transition-colors duration-200 rounded focus-visible:outline-accent/70 shrink-0 p-1.5 -mx-1.5"
5454
@click="router.back()"
55+
v-show="router.options.history.state.back !== null"
5556
>
5657
<span class="i-carbon:arrow-left rtl-flip w-4 h-4" aria-hidden="true" />
5758
<span class="sr-only sm:not-sr-only">{{ $t('nav.back') }}</span>

0 commit comments

Comments
 (0)