Skip to content

Commit

Permalink
Merge pull request #1220 from DarkFlorist/website-access-search-type
Browse files Browse the repository at this point in the history
fix website access search type error
  • Loading branch information
KillariDev authored Dec 10, 2024
2 parents 0c1bae1 + 483f0ae commit 6b82d5c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/ts/background/websiteAccessSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ function calculateWebsiteAccessScore(entry: WebsiteAccess, query: string): Searc
const titleMatch = entry.website.title ? computeSearchMatch(query, entry.website.title.toLowerCase()) : undefined
const addressMatches = entry.addressAccess?.map((addr: WebsiteAddressAccess) => computeSearchMatch(query, addressString(addr.address).toLowerCase())) || []

const bestAddressMatch = addressMatches.length > 0 ? addressMatches.reduce(selectLongerMatch) : undefined

const bestResult = [urlMatch, titleMatch, bestAddressMatch]
const bestResult = [urlMatch, titleMatch, ...addressMatches]
.filter((x): x is NonNullable<typeof x> => x !== undefined)
.reduce(selectLongerMatch, { length: 0, location: Infinity })

Expand Down

0 comments on commit 6b82d5c

Please sign in to comment.