From 7b24e674b09ff3573bec729391863ac77d1c8c67 Mon Sep 17 00:00:00 2001 From: cryptotavares Date: Thu, 12 Dec 2024 15:24:50 +0000 Subject: [PATCH] chore: prevent useAsyncResult triggering re-renders --- ui/hooks/useAsyncResult.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/hooks/useAsyncResult.ts b/ui/hooks/useAsyncResult.ts index 338796c7e6c0..ed315d2e7332 100644 --- a/ui/hooks/useAsyncResult.ts +++ b/ui/hooks/useAsyncResult.ts @@ -32,7 +32,9 @@ export function useAsyncResult( }); useEffect(() => { - setResult({ pending: true }); + if (!result.pending) { + setResult({ pending: true }); + } let cancelled = false; asyncFn() .then((value) => {