Skip to content

Commit 3e9c8e8

Browse files
committed
fix: add navigation fix for count and type links
1 parent 51134ac commit 3e9c8e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/scripts/engine.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Engine {
6868
event.preventDefault();
6969
event.stopPropagation();
7070
const count = parseInt(link.innerText);
71-
const type = getType(search);
71+
const type = getType(search) || this.type;
7272
if (count) {
7373
if (type)
7474
window.history.replaceState(
@@ -113,7 +113,7 @@ class Engine {
113113
event.preventDefault();
114114
event.stopPropagation();
115115
const type = link.innerText.toLowerCase();
116-
const count = getCount(search);
116+
const count = getCount(search) || this.count;
117117
if (type) {
118118
if (count)
119119
window.history.replaceState(
@@ -142,7 +142,7 @@ class Engine {
142142
const count = getCount(search);
143143
const type = getType(search);
144144
let href = count ? `${ml.pathname}?count=${count}` : ml.pathname;
145-
if (type) href += `${count ? '&' : ''}type=${type}`;
145+
if (type) href += `${count ? '&' : '?'}type=${type}`;
146146
window.location.href = href;
147147
});
148148
});

0 commit comments

Comments
 (0)