fix back button in spa not working between two pages that both have hash fragments

This commit is contained in:
Jacky Zhao
2023-08-17 01:34:50 -07:00
parent 58d9dc0528
commit 07a327e05a
4 changed files with 15 additions and 11 deletions

View File

@ -148,7 +148,6 @@ document.addEventListener("nav", async (e: unknown) => {
async function onType(e: HTMLElementEventMap["input"]) {
const term = (e.target as HTMLInputElement).value
const searchResults = (await index?.searchAsync(term, numSearchResults)) ?? []
console.log(searchResults)
const getByField = (field: string): number[] => {
const results = searchResults.filter((x) => x.field === field)
return results.length === 0 ? [] : ([...results[0].result] as number[])