From 244dac6db7ff9b4154562713e724abf07226f996 Mon Sep 17 00:00:00 2001 From: Oluwatobi Bamidele Date: Wed, 13 Dec 2023 22:33:16 +0100 Subject: [PATCH] fix: ensure budget is only set after admin is is settled --- src/components/App/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index a7f520d1e..206f58f0b 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -114,8 +114,6 @@ export const App = () => { await fetchData(searchTerm) setSidebarOpen(true) - - await executeIfProd(async () => updateBudget(setBudget)) }, [fetchData, searchTerm, setSphinxModalOpen, setSidebarOpen, setBudget]) useEffect(() => { @@ -167,11 +165,13 @@ export const App = () => { if (isAdmin.isAdmin) { setIsAdmin(true) } + + await updateBudget(setBudget) }) } catch (error) { /* not an admin */ } - }, [setIsAdmin, setTribeHost, setTribeUuid, setPubKey]) + }, [setIsAdmin, setTribeHost, setTribeUuid, setPubKey, setBudget]) // setup socket useEffect(() => {