Skip to content

Commit

Permalink
fix: prevent looping requests to keyvalue in recent searches (#6480)
Browse files Browse the repository at this point in the history
  • Loading branch information
cngonzalez committed Apr 29, 2024
1 parent 3da55ae commit 232385e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export function useStoredSearch(): [StoredSearch, (_value: StoredSearch) => void
.pipe(
startWith(defaultValue as any),
map((data: StoredSearch) => {
if (!data) {
return defaultValue
}
// Check if the version matches RECENT_SEARCH_VERSION
if (data?.version !== RECENT_SEARCH_VERSION) {
// If not, return the default object and mutate the store (per original verifySearchVersionNumber logic)
Expand Down

0 comments on commit 232385e

Please sign in to comment.