Skip to content

Commit

Permalink
Merge branch 'hotfix/3.19.23'
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed May 10, 2024
2 parents 31b03b0 + 9e3914a commit ee85a59
Show file tree
Hide file tree
Showing 9 changed files with 896 additions and 664 deletions.
2 changes: 1 addition & 1 deletion external/@worldbrain/memex-common
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "worldbrain-extension",
"version": "3.19.22",
"version": "3.19.23",
"homepage": "https://memex.garden",
"repository": "https://github.com/WorldBrain/Memex",
"scripts": {
Expand Down

This file was deleted.

This file was deleted.

11 changes: 8 additions & 3 deletions src/dashboard-refactor/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
initNormalizedState,
NormalizedState,
} from '@worldbrain/memex-common/lib/common-ui/utils/normalized-state'
import { eventProviderDomains } from '@worldbrain/memex-common/lib/constants'
import { EVENT_PROVIDER_DOMAINS } from '@worldbrain/memex-common/lib/constants'
import type {
PageAnnotationsCacheInterface,
UnifiedList,
Expand Down Expand Up @@ -110,12 +110,17 @@ export const stateToSearchParams = (
filterByListIds.push(listData.localId!)
}

const isBlankSearch = !searchFilters.searchQuery.trim().length

// Blank search doesn't use standard skip+limit pagination. Instead it requires the caller to keep
// track of the oldest timestamp and supply that as the new upper-bound on each reinvocation
const blankSearchUpperBound = !searchFilters.searchQuery.trim().length
const blankSearchUpperBound = isBlankSearch
? searchResults.blankSearchOldestResultTimestamp
: null

// Use a larger page size for blank searches to reduce the chance of duped results, due to annots/visits/bookmarks appearing in different result pages
const limit = isBlankSearch ? searchFilters.limit * 3 : searchFilters.limit

// TODO: Dynamically set these flags based on state
const termsSearchOpts: TermsSearchOpts = {
matchNotes: true,
Expand All @@ -126,8 +131,8 @@ export const stateToSearchParams = (
}

return {
limit,
skip: searchFilters.skip,
limit: searchFilters.limit,
query: searchFilters.searchQuery,
filterByDomains: searchFilters.domainsIncluded,
filterByListIds,
Expand Down
Loading

0 comments on commit ee85a59

Please sign in to comment.