Skip to content

Commit

Permalink
fix: allow onErrorRetry on inactive tab without focus/reconnect reval…
Browse files Browse the repository at this point in the history
…idation

fix: #2543
  • Loading branch information
qkdreyer authored Dec 4, 2023
1 parent 1d81109 commit 46c3dee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/use-swr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ export const useSWRHandler = <Data = any, Error = any>(
(isFunction(shouldRetryOnError) &&
shouldRetryOnError(err as Error))
) {
if (isActive()) {
if (!getConfig().revalidateOnFocus || !getConfig().revalidateOnReconnect || isActive()) {
// If it's inactive, stop. It will auto-revalidate when
// refocusing or reconnecting.
// When retrying, deduplication is always enabled.
Expand Down

0 comments on commit 46c3dee

Please sign in to comment.