Skip to content

Commit

Permalink
Remove redundant check, minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbaroni committed Jan 5, 2025
1 parent c024ba6 commit f0d4737
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/state/internal/createQueryStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -809,16 +809,14 @@ export function createQueryStore<
if (state.enabled) {
const currentParams = getCurrentResolvedParams();
const currentKey = state.queryKey;
if (currentKey !== lastFetchKey || !state.queryCache[currentKey] || state.isStale()) {
if (currentKey !== lastFetchKey || state.isStale()) {
state.fetch(currentParams, undefined);
} else {
scheduleNextFetch(currentParams, undefined);
}
} else {
if (activeRefetchTimeout) {
clearTimeout(activeRefetchTimeout);
activeRefetchTimeout = null;
}
} else if (activeRefetchTimeout) {
clearTimeout(activeRefetchTimeout);
activeRefetchTimeout = null;
}
}
};
Expand Down

0 comments on commit f0d4737

Please sign in to comment.