Revert lastFetchParamsRef on failed fetch to allow retries
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -311,6 +311,7 @@ export const EntityListProvider = <EntityFilters extends DefaultEntityFilters>(
|
||||
if (isEqual(fetchParams, lastFetchParamsRef.current)) {
|
||||
return;
|
||||
}
|
||||
const prevFetchParams = lastFetchParamsRef.current;
|
||||
lastFetchParamsRef.current = fetchParams;
|
||||
|
||||
const gen = ++fetchGenRef.current;
|
||||
@@ -324,6 +325,7 @@ export const EntityListProvider = <EntityFilters extends DefaultEntityFilters>(
|
||||
}
|
||||
} catch (e) {
|
||||
if (gen === fetchGenRef.current) {
|
||||
lastFetchParamsRef.current = prevFetchParams;
|
||||
setError(e as Error);
|
||||
}
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user