From 77526a77f16a921a2500b89a06dcb28d1e532f65 Mon Sep 17 00:00:00 2001 From: Hippo Date: Tue, 24 Dec 2019 15:16:33 +0530 Subject: [PATCH] Fix typo during last post detection in PreviousNext We're at the last post when (length-1) > i, not length > i, because we're indexing from 0 but starting from 1 --- src/components/PreviousNext.vue | 2 +- src/layouts/Default.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/PreviousNext.vue b/src/components/PreviousNext.vue index c76316a..98d00ab 100644 --- a/src/components/PreviousNext.vue +++ b/src/components/PreviousNext.vue @@ -95,7 +95,7 @@ export default { if (i > 0) { this.PreviousNexts.push(allBlogs[i - 1].node); } - if (allBlogs.length > i) { + if (allBlogs.length -1 > i) { this.PreviousNexts.push(allBlogs[i + 1].node); } } diff --git a/src/layouts/Default.vue b/src/layouts/Default.vue index 868e0a7..10b5551 100644 --- a/src/layouts/Default.vue +++ b/src/layouts/Default.vue @@ -38,4 +38,4 @@ } } } - \ No newline at end of file +