Skip to content

Commit 3b3773b

Browse files
authored
fix: search query submit (#593)
1 parent b7ac75d commit 3b3773b

File tree

1 file changed

+5
-3
lines changed
  • src/unfold/static/unfold/js

1 file changed

+5
-3
lines changed

src/unfold/static/unfold/js/app.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,17 @@ const submitSearch = () => {
101101
.split("&")
102102
.map((param) => param.split("="))
103103
.reduce((values, [key, value]) => {
104-
if (key == "q") {
105-
values[key] = searchString;
106-
} else {
104+
if (key && key !== "q") {
107105
values[key] = value;
108106
}
109107

110108
return values;
111109
}, {});
112110

111+
if (searchString) {
112+
queryParams["q"] = searchString;
113+
}
114+
113115
const result = Object.entries(queryParams)
114116
.map(([key, value]) => `${key}=${value}`)
115117
.join("&");

0 commit comments

Comments
 (0)