We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d97fcf commit 5a9de2dCopy full SHA for 5a9de2d
1 file changed
src/PageCollector.ts
@@ -144,12 +144,11 @@ export class PageCollector<T> {
144
}
145
146
const data: T[] = [];
147
- const navigationNum = Math.min(
148
- navigations.length - 1,
149
- this.#maxNavigationSaved,
150
- );
151
- for (let index = navigationNum; index >= 0; index--) {
152
- data.push(...navigations[index]);
+
+ for (let index = this.#maxNavigationSaved; index >= 0; index--) {
+ if (navigations[index]) {
+ data.push(...navigations[index]);
+ }
153
154
return data;
155
0 commit comments