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:
Fredrik Adelöw
2026-05-20 20:24:34 +02:00
parent 779749fbd7
commit ffa59be219
@@ -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 {