Skip to content

Commit

Permalink
fixed collection page wsod on some undefined is situations (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog authored Feb 1, 2024
1 parent 5854b84 commit 3e93553
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v1.0.0-beta.23 - [February 1, 2024](https://github.com/lando/vitepress-theme-default-plus/releases/tag/v1.0.0-beta.23)

* Fixed collection `WSOD` in some `undefined` id situations

## v1.0.0-beta.22 - [January 31, 2024](https://github.com/lando/vitepress-theme-default-plus/releases/tag/v1.0.0-beta.22)

* Fixed default `sidebarEnder` for `lando` config sets
Expand Down
4 changes: 2 additions & 2 deletions client/use-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export default function useCollection(type = undefined) {
// prev page or loop back to end unless the end is me
const prevPage = computed(() => {
const prev = pages[findCurrentIndex() - 1] ?? pages[pages.length - 1];
return prev.id !== page.value.id ? prev : undefined;
return prev.id !== page?.value?.id ? prev : undefined;
});
// next page or loop back to beginning unless the beginning is me
const nextPage = computed(() => {
const next = pages[findCurrentIndex() + 1] ?? pages[0];
return next.id !== page.value.id ? next : undefined;
return next.id !== page?.value?.id ? next : undefined;
});

// these are meant to replace the core next|prev nav links
Expand Down

0 comments on commit 3e93553

Please sign in to comment.