diff --git a/libwallet/assets/wallet/wallet_config.go b/libwallet/assets/wallet/wallet_config.go index 09bd3ca12..c146b6f94 100644 --- a/libwallet/assets/wallet/wallet_config.go +++ b/libwallet/assets/wallet/wallet_config.go @@ -56,7 +56,6 @@ const ( LanguagePreferenceKey = "app_language" DarkModeConfigKey = "dark_mode" HideTotalBalanceConfigKey = "hideTotalUSDBalance" - DexFirstVisitKey = "dexFirstVisit" PassphraseTypePin int32 = 0 PassphraseTypePass int32 = 1 diff --git a/libwallet/assets_config.go b/libwallet/assets_config.go index 01fea5fb7..dde205d30 100644 --- a/libwallet/assets_config.go +++ b/libwallet/assets_config.go @@ -278,15 +278,3 @@ func (mgr *AssetsManager) SetTotalBalanceVisibility(data bool) { func genKey(prefix, identifier interface{}) string { return fmt.Sprintf("%v-%v", prefix, identifier) } - -// IsDexFirstVisit checks if its the users first visit to DCRDEX page -func (mgr *AssetsManager) IsDexFirstVisit() bool { - var data bool - mgr.db.ReadWalletConfigValue(sharedW.DexFirstVisitKey, &data) - return data -} - -// SetDexFirstVisit sets the first visit to DCRDEX . -func (mgr *AssetsManager) SetDexFirstVisit(data bool) { - mgr.db.SaveWalletConfigValue(sharedW.DexFirstVisitKey, data) -} diff --git a/ui/load/utils.go b/ui/load/utils.go index d656fc792..9b2c3d727 100644 --- a/ui/load/utils.go +++ b/ui/load/utils.go @@ -16,7 +16,6 @@ const ( SpendUnmixedFundsKey = "spend_unmixed_funds" KnownDexServersConfigKey = "known_dex_servers" GapLimitConfigKey = "gap_limit_key" - DexFirstVisitKey = "dexFirstVisit" ) // SetCurrentAppWidth stores the current width of the app's window. diff --git a/ui/page/dcrdex/dcrdex_page.go b/ui/page/dcrdex/dcrdex_page.go index 9dffdc59e..a1c29b36c 100644 --- a/ui/page/dcrdex/dcrdex_page.go +++ b/ui/page/dcrdex/dcrdex_page.go @@ -11,7 +11,7 @@ import ( "github.com/crypto-power/cryptopower/ui/values" ) -const DCRDEXID = "DCRDEXID" +const DCRDEXPageID = "DCRDEXPageID" type ( C = layout.Context @@ -28,20 +28,20 @@ type DEXPage struct { openTradeMainPage *cryptomaterial.Clickable splashPageInfoButton cryptomaterial.IconButton - enableDEXBtn cryptomaterial.Button - navigateToSettingsBtn cryptomaterial.Button - inited bool // TODO: Set value + finalizeOnboardingBtn cryptomaterial.Button + isDexFirstVisit bool } func NewDEXPage(l *load.Load) *DEXPage { dp := &DEXPage{ Load: l, - MasterPage: app.NewMasterPage(DCRDEXID), + MasterPage: app.NewMasterPage(DCRDEXPageID), openTradeMainPage: l.Theme.NewClickable(false), + isDexFirstVisit: true, } dp.initSplashPageWidgets() - dp.navigateToSettingsBtn = dp.Theme.Button(values.String(values.StrStartTrading)) + dp.finalizeOnboardingBtn = dp.Theme.Button(values.String(values.StrStartTrading)) return dp } @@ -49,7 +49,7 @@ func NewDEXPage(l *load.Load) *DEXPage { // differentiate this page from other pages. // Part of the load.Page interface. func (pg *DEXPage) ID() string { - return DCRDEXID + return DCRDEXPageID } // OnNavigatedTo is called when the page is about to be displayed and may be @@ -70,7 +70,7 @@ func (pg *DEXPage) OnNavigatedTo() { // eventually drawn on screen. // Part of the load.Page interface. func (pg *DEXPage) Layout(gtx C) D { - if !pg.WL.AssetsManager.IsDexFirstVisit() { + if pg.isDexFirstVisit { return components.UniformPadding(gtx, pg.splashPage) } return layout.Stack{}.Layout(gtx, @@ -100,8 +100,8 @@ func (pg *DEXPage) HandleUserInteractions() { if pg.splashPageInfoButton.Button.Clicked() { pg.showInfoModal() } - if pg.navigateToSettingsBtn.Button.Clicked() { - pg.WL.AssetsManager.SetDexFirstVisit(true) + if pg.finalizeOnboardingBtn.Button.Clicked() { + pg.isDexFirstVisit = false } } diff --git a/ui/page/dcrdex/dex_splash_page.go b/ui/page/dcrdex/dex_splash_page.go index 66a561a1d..8f94c3c83 100644 --- a/ui/page/dcrdex/dex_splash_page.go +++ b/ui/page/dcrdex/dex_splash_page.go @@ -13,7 +13,6 @@ import ( func (pg *DEXPage) initSplashPageWidgets() { _, pg.splashPageInfoButton = components.SubpageHeaderButtons(pg.Load) - pg.enableDEXBtn = pg.Theme.Button(values.String(values.StrBack)) } func (pg *DEXPage) splashPage(gtx layout.Context) layout.Dimensions { @@ -58,7 +57,7 @@ func (pg *DEXPage) splashPage(gtx layout.Context) layout.Dimensions { return layout.Inset{ Top: values.MarginPadding24, Right: values.MarginPadding16, - }.Layout(gtx, pg.navigateToSettingsBtn.Layout) + }.Layout(gtx, pg.finalizeOnboardingBtn.Layout) }), ) }