Fix changelog navigation directions (#411)

This commit is contained in:
Giancarlo Buomprisco
2025-11-10 10:50:21 +07:00
committed by GitHub
parent 56fa498b9a
commit 1583a743ce

View File

@@ -35,17 +35,17 @@ async function changelogEntryLoader(slug: string) {
// Find previous and next entries in the timeline // Find previous and next entries in the timeline
const currentIndex = allEntries.items.findIndex((item) => item.slug === slug); const currentIndex = allEntries.items.findIndex((item) => item.slug === slug);
const previousEntry = const newerEntry =
currentIndex > 0 ? allEntries.items[currentIndex - 1] : null; currentIndex > 0 ? allEntries.items[currentIndex - 1] : null;
const nextEntry = const olderEntry =
currentIndex < allEntries.items.length - 1 currentIndex < allEntries.items.length - 1
? allEntries.items[currentIndex + 1] ? allEntries.items[currentIndex + 1]
: null; : null;
return { return {
entry, entry,
previousEntry, previousEntry: olderEntry,
nextEntry, nextEntry: newerEntry,
}; };
} }