Skip to content

Commit

Permalink
clean code and fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeBoy committed Jul 12, 2024
1 parent 018394d commit 93db25e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
10 changes: 5 additions & 5 deletions libwallet/assets_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
// TODO: This is the main app's log filename, should probably be defined
// elsewhere.
const LogFilename = "cryptopower.log"
const assetId = "assets_manager"
const assetID = "assets_manager"

// Assets is a struct that holds all the assets supported by the wallet.
type Assets struct {
Expand Down Expand Up @@ -965,22 +965,22 @@ func (mgr *AssetsManager) DeleteDEXData() error {
func (mgr *AssetsManager) ListenAssetChange(listen func()) {
// Reload wallets unmixed balance and reload UI on new blocks.
txAndBlockNotificationListener := &sharedW.TxAndBlockNotificationListener{
OnTransactionConfirmed: func(walletID int, hash string, blockHeight int32) {
OnTransactionConfirmed: func(_ int, _ string, _ int32) {
listen()
},
OnTransaction: func(walletID int, transaction *sharedW.Transaction) {
OnTransaction: func(_ int, _ *sharedW.Transaction) {
listen()
},
}
for _, wallet := range mgr.AllWallets() {
if err := wallet.AddTxAndBlockNotificationListener(txAndBlockNotificationListener, assetId); err != nil {
if err := wallet.AddTxAndBlockNotificationListener(txAndBlockNotificationListener, assetID); err != nil {
log.Errorf("Can't listen tx and block notification for %s wallet", wallet.GetWalletName())
}
}
}

func (mgr *AssetsManager) RemoveAssetChange() {
for _, wallet := range mgr.AllWallets() {
wallet.RemoveTxAndBlockNotificationListener(assetId)
wallet.RemoveTxAndBlockNotificationListener(assetID)
}
}
4 changes: 0 additions & 4 deletions ui/page/root/overview_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -1185,10 +1185,6 @@ func (pg *OverviewPage) listenForMixerNotifications() {
pg.reloadBalances()
pg.ParentWindow().Reload()
},
OnTransactionConfirmed: func(walletID int, hash string, blockHeight int32) {
},
OnTransaction: func(walletID int, transaction *sharedW.Transaction) {
},
}

wallets := pg.AssetsManager.AllWallets()
Expand Down
2 changes: 1 addition & 1 deletion ui/page/root/wallet_selector_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (pg *WalletSelectorPage) pageContentLayout(gtx C) D {
Height: cryptomaterial.MatchParent,
Padding: components.HorizontalInset(values.MarginPaddingTransform(pg.IsMobileView(), values.MarginPadding16)),
}.Layout2(gtx, func(gtx C) D {
return pg.Theme.List(pg.scrollContainer).Layout(gtx, 1, func(gtx C, i int) D {
return pg.Theme.List(pg.scrollContainer).Layout(gtx, 1, func(gtx C, _ int) D {
return assetDropdown(gtx)
})
})
Expand Down

0 comments on commit 93db25e

Please sign in to comment.