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

This commit is contained in:
Alex Gleason 2023-07-20 15:17:44 -05:00
parent 7944de8305
commit 6188d44e56
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 1 additions and 1 deletions

View File

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