improved query string handling
This commit is contained in:
parent
33476e7fc5
commit
3bd4f2d4c8
1 changed files with 8 additions and 4 deletions
|
@ -137,6 +137,7 @@ function _Search() {
|
|||
const [searchInput, setSearchInput] = useState(query.query)
|
||||
|
||||
function doSearch() {
|
||||
// remove focus from search bar to prevent accidental multiple search
|
||||
if (inputRef.current) inputRef.current.blur()
|
||||
|
||||
_history.push({
|
||||
|
@ -220,7 +221,9 @@ function _Search() {
|
|||
...(query.to && {
|
||||
to: query.to,
|
||||
}),
|
||||
...(query.tags.length > 0 && {
|
||||
tags: query.tags.join(","),
|
||||
}),
|
||||
}
|
||||
|
||||
// convert Date to YYYY-MM-DD string if it exists
|
||||
|
@ -262,7 +265,8 @@ function _Search() {
|
|||
<br />
|
||||
<small>
|
||||
<TagList>
|
||||
{query.tags?.map((tag) => {
|
||||
{query.tags.length > 0 &&
|
||||
query.tags.map((tag) => {
|
||||
return <Tag key={tag} text={tag} />
|
||||
})}
|
||||
</TagList>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue