From 9810b7732957e0ec45c31a5e77b063ad19248510 Mon Sep 17 00:00:00 2001 From: Kennedy Izuegbu Date: Thu, 17 Oct 2024 08:52:07 +0100 Subject: [PATCH] hide governance wallet dropdown if only one dcr wallet is available (#685) --- ui/page/governance/consensus_page.go | 2 +- ui/page/governance/proposals_page.go | 2 +- ui/page/governance/treasury_page.go | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/page/governance/consensus_page.go b/ui/page/governance/consensus_page.go index 3778baf3e..0dd5cb733 100644 --- a/ui/page/governance/consensus_page.go +++ b/ui/page/governance/consensus_page.go @@ -466,7 +466,7 @@ func (pg *ConsensusPage) leftDropdown(gtx C) D { if pg.walletDropDown == nil { return D{} } - if len(pg.assetWallets) == 0 { + if len(pg.assetWallets) < 2 { return D{} } return layout.W.Layout(gtx, pg.walletDropDown.Layout) diff --git a/ui/page/governance/proposals_page.go b/ui/page/governance/proposals_page.go index 2ed797bcd..6dc348404 100644 --- a/ui/page/governance/proposals_page.go +++ b/ui/page/governance/proposals_page.go @@ -401,7 +401,7 @@ func (pg *ProposalsPage) leftDropdown(gtx C) D { if pg.walletDropDown == nil { return D{} } - if len(pg.assetWallets) == 0 { + if len(pg.assetWallets) < 2 { return D{} } return layout.W.Layout(gtx, pg.walletDropDown.Layout) diff --git a/ui/page/governance/treasury_page.go b/ui/page/governance/treasury_page.go index 8a2d7ffc2..8c00518a3 100644 --- a/ui/page/governance/treasury_page.go +++ b/ui/page/governance/treasury_page.go @@ -273,6 +273,9 @@ func (pg *TreasuryPage) dropdownLayout(gtx layout.Context) layout.Dimensions { if pg.walletDropDown == nil { return D{} } + if len(pg.assetWallets) < 2 { + return D{} + } return layout.W.Layout(gtx, pg.walletDropDown.Layout) }), layout.Rigid(func(gtx C) D {