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 committed Jan 31, 2024
1 parent 30cfa8c commit c98a215
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/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 c98a215

Please sign in to comment.