Skip to content

Commit

Permalink
add logic update total balance for overview page
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeBoy committed Jul 17, 2024
1 parent b891a8e commit cbcd906
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion ui/page/root/home_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ func (hp *HomePage) OnNavigatedTo() {
}

hp.AssetsManager.WatchBalanceChange(func() {
fmt.Println("Update Total balance")
go hp.CalculateAssetsUSDBalance()
})
}
Expand Down
12 changes: 12 additions & 0 deletions ui/page/root/overview_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,18 @@ func (pg *OverviewPage) listenForMixerNotifications() {
}
}

// add rate listener
rateListener := &ext.RateListener{
OnRateUpdated: func() {
pg.updateAssetsUSDBalance()
},
}
if !pg.AssetsManager.RateSource.IsRateListenerExist(OverviewPageID) {
if err := pg.AssetsManager.RateSource.AddRateListener(rateListener, OverviewPageID); err != nil {
log.Error("Can't listen rate notification ")
}
}

pg.sortedMixerSlideKeys = make([]int, 0)
pg.mixerSliderData = make(map[int]*mixerData)
for _, wal := range wallets {
Expand Down

0 comments on commit cbcd906

Please sign in to comment.