useEntity: don't refetch when there's an error

environments/review-renovate-r-pdslja/deployments/3639
Alex Gleason 2023-07-20 15:17:44 -05:00
rodzic 7944de8305
commit 6188d44e56
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -51,7 +51,7 @@ function useEntity<TEntity extends Entity>(
};
useEffect(() => {
if (!isEnabled) return;
if (!isEnabled || error) return;
if (!entity || opts.refetch) {
fetchEntity();
}