diff --git a/src/components/header/NavBar.vue b/src/components/header/NavBar.vue index b7eb845d..843bdca4 100644 --- a/src/components/header/NavBar.vue +++ b/src/components/header/NavBar.vue @@ -63,15 +63,19 @@ const hasNext = computed(() => { const [nextPageLabel, previousPageLabel, nextDocumentLabel, previousDocumentLabel]: string[] = getNavButtonsLabels(configStore.config) -const nextButtonLabel = computed(() => ( -itemIndex.value === manifest.value.sequence.length - 1 - ? `${nextDocumentLabel}` - : `${nextPageLabel}`)); +const nextButtonLabel = computed((lastValue: string) => { + if (itemIndex.value === -1) return lastValue; + + return itemIndex.value === manifest.value.sequence.length - 1 + ? `${nextDocumentLabel}` + : `${nextPageLabel}`; +}); -const prevButtonLabel = computed(() => (itemIndex.value === 0 - ? `${previousDocumentLabel}` - : `${previousPageLabel}`)); +const prevButtonLabel = computed((lastValue: string) => { + if (itemIndex.value === -1) return lastValue; + return itemIndex.value === 0 ? `${previousDocumentLabel}` : `${previousPageLabel}`; +}); function prev() { const prevIndex = itemIndex.value - 1;