Merge branch 'useentity-error' into 'develop'

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

See merge request soapbox-pub/soapbox!2613
This commit is contained in:
Alex Gleason 2023-07-20 20:26:42 +00:00
commit a6386a92ed

View file

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