Skip to content

Commit

Permalink
fix(Fixing bug when balance comes 0 from database, the function not s…
Browse files Browse the repository at this point in the history
…et in store): ✨
  • Loading branch information
kayooliveira committed Sep 16, 2022
1 parent cb603d6 commit 06ea7ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/layouts/DefaultLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ export function DefaultLayout() {
onValue(walletRef, async snapshot => {
if (snapshot.exists()) {
const data = snapshot.val()
if (data.currentBalance && isAuth) {
await setCurrentBalance(data.currentBalance)
if (data && isAuth) {
console.log(data)
setCurrentBalance(data.currentBalance)
return
}
return
Expand Down

1 comment on commit 06ea7ba

@vercel
Copy link

@vercel vercel bot commented on 06ea7ba Sep 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.