Skip to content

Commit 0853a1a

Browse files
committed
Fix error on README page with expanded entry points
1 parent 774aa36 commit 0853a1a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Bug Fixes
44

55
- Actually fixed `@category` tag incorrectly appearing on function types if used on a type alias, #1745.
6+
- Fix error in console when a page contains no documentation items.
67

78
## v0.22.7 (2021-10-25)
89

src/lib/output/themes/default/assets/typedoc/services/Viewport.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ export class Viewport extends EventTarget {
3939

4040
/**
4141
* The sticky side nav that contains members of the current page.
42+
* Might not present on the home page if the project uses `entryPointStrategy` set to `Expand`.
4243
*/
43-
secondaryNav: HTMLElement;
44+
secondaryNav?: HTMLElement;
4445

4546
/**
4647
* Create new Viewport instance.
@@ -51,7 +52,7 @@ export class Viewport extends EventTarget {
5152
this.toolbar = <HTMLDivElement>(
5253
document.querySelector(".tsd-page-toolbar")
5354
);
54-
this.secondaryNav = <HTMLElement>(
55+
this.secondaryNav = <HTMLElement | undefined>(
5556
document.querySelector(".tsd-navigation.secondary")
5657
);
5758

@@ -123,7 +124,7 @@ export class Viewport extends EventTarget {
123124
this.showToolbar = this.lastY >= this.scrollTop || this.scrollTop <= 0;
124125
if (isShown !== this.showToolbar) {
125126
this.toolbar.classList.toggle("tsd-page-toolbar--hide");
126-
this.secondaryNav.classList.toggle("tsd-navigation--toolbar-hide");
127+
this.secondaryNav?.classList.toggle("tsd-navigation--toolbar-hide");
127128
}
128129
this.lastY = this.scrollTop;
129130
}

0 commit comments

Comments
 (0)