Skip to content

Commit

Permalink
Merge pull request #685 from stakwork/fix/auth
Browse files Browse the repository at this point in the history
fix: ensure budget is only set after admin is is settled
  • Loading branch information
Rassl authored Dec 13, 2023
2 parents 114d201 + 244dac6 commit 3fefcc0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ export const App = () => {

await fetchData(searchTerm)
setSidebarOpen(true)

await executeIfProd(async () => updateBudget(setBudget))
}, [fetchData, searchTerm, setSphinxModalOpen, setSidebarOpen, setBudget])

useEffect(() => {
Expand Down Expand Up @@ -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(() => {
Expand Down

0 comments on commit 3fefcc0

Please sign in to comment.