Skip to content

Commit

Permalink
fix crash on wallet page (decred#136)
Browse files Browse the repository at this point in the history
* make pass modal fill entire window
* fix selected wallet mismatch
  • Loading branch information
Sirmorrison authored Jun 8, 2020
1 parent 4079ec2 commit 72382ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions ui/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ func (page pageCommon) LayoutWithWallets(gtx *layout.Context, body layout.Widget
*page.selectedAccount = 0
page.accountsTab.Selected = 0
}
if *page.selectedWallet == 0 {
page.walletsTab.Selected = *page.selectedWallet
}
page.walletsTab.Separator = false
page.walletsTab.Layout(gtx, body)
}
Expand Down
2 changes: 1 addition & 1 deletion ui/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ func (win *Window) updateStates(update interface{}) {
win.states.creating = false
win.window.Invalidate()
case wallet.DeletedWallet:
win.selected = 0
win.current = PageWallet
win.states.dialog = false
win.states.deleted = true
win.reloadTabs()
win.window.Invalidate()
case wallet.AddedAccount:
win.states.dialog = false
Expand Down
5 changes: 2 additions & 3 deletions ui/wallet_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func (page *walletPage) Layout(common pageCommon) {
}
if common.states.deleted {
page.subPage = subWalletMain
common.states.deleted = false
}
}

Expand Down Expand Up @@ -333,9 +334,7 @@ func (page *walletPage) subDelete(common pageCommon) {
})
})
if page.isPasswordModalOpen {
common.Layout(gtx, func() {
page.passwordModal.Layout(gtx, page.confirm, page.cancel)
})
page.passwordModal.Layout(gtx, page.confirm, page.cancel)
}
}

Expand Down

0 comments on commit 72382ea

Please sign in to comment.