Skip to content

Commit fbb4637

Browse files
committed
fix(typescript): handle github config set to false
1 parent 7f7a2c7 commit fbb4637

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

layer/app/components/app/AppFooterRight.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const links = computed(() => [
88
'target': '_blank',
99
'aria-label': `${key} social link`,
1010
})),
11-
appConfig.github?.url && {
11+
appConfig.github && appConfig.github.url && {
1212
'icon': 'i-simple-icons-github',
1313
'to': appConfig.github.url,
1414
'target': '_blank',

layer/app/components/app/AppHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const site = useSiteConfig()
66
77
const { localePath, isEnabled, locales } = useDocusI18n()
88
9-
const links = computed(() => appConfig.github?.url
9+
const links = computed(() => appConfig.github && appConfig.github.url
1010
? [
1111
{
1212
'icon': 'i-simple-icons-github',

layer/app/pages/[[lang]]/[...slug].vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,18 @@ defineOgImageComponent('Docs', {
4646
headline: headline.value,
4747
})
4848
49+
const github = computed(() => appConfig.github ? appConfig.github : null)
50+
4951
const editLink = computed(() => {
50-
if (!appConfig.github) {
52+
if (!github.value) {
5153
return
5254
}
5355
5456
return [
55-
appConfig.github.url,
57+
github.value.url,
5658
'edit',
57-
appConfig.github.branch,
58-
appConfig.github.rootDir,
59+
github.value.branch,
60+
github.value.rootDir,
5961
'content',
6062
`${page.value?.stem}.${page.value?.extension}`,
6163
].filter(Boolean).join('/')
@@ -92,7 +94,7 @@ const editLink = computed(() => {
9294

9395
<USeparator>
9496
<div
95-
v-if="editLink"
97+
v-if="github"
9698
class="flex items-center gap-2 text-sm text-muted"
9799
>
98100
<UButton
@@ -109,7 +111,7 @@ const editLink = computed(() => {
109111
<UButton
110112
variant="link"
111113
color="neutral"
112-
:to="`${appConfig.github.url}/issues/new/choose`"
114+
:to="`${github.url}/issues/new/choose`"
113115
target="_blank"
114116
icon="i-lucide-alert-circle"
115117
:ui="{ leadingIcon: 'size-4' }"

0 commit comments

Comments
 (0)