修复撤下 Endor 导航后历史页面的空值访问 #53
@@ -58,7 +58,8 @@ export default function DocPage({
|
||||
const [active, setActive] = useState("");
|
||||
|
||||
const siblings = docs.filter((d) => d.collection === doc.collection);
|
||||
const collectionEntry = collectionEntries(docs).find((c) => c.name === doc.collection)!.entry;
|
||||
// Historical pages remain readable even when their collection is outside the catalog.
|
||||
const collectionEntry = collectionEntries(docs).find((c) => c.name === doc.collection)?.entry ?? doc;
|
||||
const index = siblings.findIndex((d) => d.slug === doc.slug);
|
||||
useEffect(() => {
|
||||
const observer = new IntersectionObserver(
|
||||
|
||||
Reference in New Issue
Block a user