Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/query-persist-client-core/src/createPersister.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function experimental_createQueryPersister<TStorageValue = string>({
>['deserialize'],
prefix = PERSISTER_KEY_PREFIX,
refetchOnRestore = true,
filters,
filters: persistFilters,
}: StoragePersisterOptions<TStorageValue>) {
/**
* Checks whether a persisted query should be discarded.
Expand Down Expand Up @@ -280,7 +280,9 @@ export function experimental_createQueryPersister<TStorageValue = string>({
ctx: QueryFunctionContext<TQueryKey>,
query: Query,
) {
const matchesFilter = filters ? matchQuery(filters, query) : true
const matchesFilter = persistFilters
? matchQuery(persistFilters, query)
: true

// Try to restore only if we do not have any data in the cache and we have persister defined
if (matchesFilter && query.state.data === undefined && storage != null) {
Expand Down
Loading