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
This commit is contained in:
Hippo 2019-12-24 15:16:33 +05:30
parent 30f9448d72
commit 77526a77f1
2 changed files with 2 additions and 2 deletions

View file

@ -95,7 +95,7 @@ export default {
if (i > 0) { if (i > 0) {
this.PreviousNexts.push(allBlogs[i - 1].node); this.PreviousNexts.push(allBlogs[i - 1].node);
} }
if (allBlogs.length > i) { if (allBlogs.length -1 > i) {
this.PreviousNexts.push(allBlogs[i + 1].node); this.PreviousNexts.push(allBlogs[i + 1].node);
} }
} }

View file

@ -38,4 +38,4 @@
} }
} }
} }
</script> </script>