useEntity: don't refetch when there's an error
This commit is contained in:
@ -51,7 +51,7 @@ function useEntity<TEntity extends Entity>(
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!isEnabled) return;
|
||||
if (!isEnabled || error) return;
|
||||
if (!entity || opts.refetch) {
|
||||
fetchEntity();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user