Skip to content

Commit

Permalink
Redirect to rescan information page
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeBoy committed Aug 6, 2024
1 parent de0b634 commit 59cee1b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion ui/page/wallet/single_wallet_main_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,12 @@ func (swmp *SingleWalletMasterPage) OnCurrencyChanged() {
swmp.updateExchangeSetting()
}

func (swmp *SingleWalletMasterPage) changeTab(tab string) {
selectedTab[swmp.selectedWallet.GetWalletID()] = tab
swmp.PageNavigationTab.SetSelectedSegment(tab)
swmp.navigateToSelectedTab()
}

// HandleUserInteractions is called just before Layout() to determine
// if any user interaction recently occurred on the page and may be
// used to update the page's UI components shortly before they are
Expand Down Expand Up @@ -410,7 +416,7 @@ func (swmp *SingleWalletMasterPage) navigateToSelectedTab() {
case values.String(values.StrAccounts):
pg = accounts.NewAccountPage(swmp.Load, swmp.selectedWallet)
case values.String(values.StrSettings):
pg = NewSettingsPage(swmp.Load, swmp.selectedWallet, swmp.showNavigationFunc)
pg = NewSettingsPage(swmp.Load, swmp.selectedWallet, swmp.showNavigationFunc, swmp.changeTab)
}

swmp.activeTab[swmp.PageNavigationTab.SelectedSegment()] = pg.ID()
Expand Down
6 changes: 5 additions & 1 deletion ui/page/wallet/wallet_settings_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/crypto-power/cryptopower/ui/load"
"github.com/crypto-power/cryptopower/ui/modal"
"github.com/crypto-power/cryptopower/ui/page/components"
"github.com/crypto-power/cryptopower/ui/page/info"
"github.com/crypto-power/cryptopower/ui/page/security"
"github.com/crypto-power/cryptopower/ui/page/seedbackup"
s "github.com/crypto-power/cryptopower/ui/page/settings"
Expand Down Expand Up @@ -67,11 +68,12 @@ type SettingsPage struct {
connectToPeer *cryptomaterial.Switch

walletCallbackFunc func()
changeTab func(string)

peerAddr string
}

func NewSettingsPage(l *load.Load, wallet sharedW.Asset, walletCallbackFunc func()) *SettingsPage {
func NewSettingsPage(l *load.Load, wallet sharedW.Asset, walletCallbackFunc func(), changeTab func(string)) *SettingsPage {
pg := &SettingsPage{
Load: l,
GenericPageModal: app.NewGenericPageModal(WalletSettingsPageID),
Expand Down Expand Up @@ -99,6 +101,7 @@ func NewSettingsPage(l *load.Load, wallet sharedW.Asset, walletCallbackFunc func
List: layout.List{Axis: layout.Vertical},
},
walletCallbackFunc: walletCallbackFunc,
changeTab: changeTab,
}

_, pg.infoButton = components.SubpageHeaderButtons(l)
Expand Down Expand Up @@ -683,6 +686,7 @@ func (pg *SettingsPage) HandleUserInteractions(gtx C) {
}

im.Dismiss()
pg.changeTab(info.InfoID)
return true
})

Expand Down

0 comments on commit 59cee1b

Please sign in to comment.