Skip to content

Commit

Permalink
Merge pull request #74 from XDagger/develop
Browse files Browse the repository at this point in the history
show initialize fail when address error
  • Loading branch information
swordlet authored May 3, 2023
2 parents dd6a628 + 5e17170 commit 19ec8fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions wallet/components/logon_win.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,17 @@ func (l *LogonWin) showPasswordDialog(title, ok, dismiss string, parent fyne.Win
} else {
NewWalletWindow(l.WalletType)
}

} else if res < -64 {
l.loginIncorrect(i18n.GetString("LogonWindow_InitializeFailed"))
} else {
l.passwordIncorrect()
l.loginIncorrect(i18n.GetString("Message_PasswordIncorrect"))
}
} else if l.WalletType == HAS_ONLY_BIP {
res := ConnectBipWallet(PwdStr)
if res {
NewWalletWindow(l.WalletType)
} else {
l.passwordIncorrect()
l.loginIncorrect(i18n.GetString("Message_PasswordIncorrect"))
}
}
} else {
Expand All @@ -208,8 +209,8 @@ func (l *LogonWin) showPasswordDialog(title, ok, dismiss string, parent fyne.Win
}, parent)
}

func (l *LogonWin) passwordIncorrect() {
StatusInfo.Text = i18n.GetString("Message_PasswordIncorrect")
func (l *LogonWin) loginIncorrect(msg string) {
StatusInfo.Text = msg
canvas.Refresh(StatusInfo)
time.Sleep(time.Second * 5)
l.Win.Close()
Expand Down
6 changes: 3 additions & 3 deletions wallet/components/wallet_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ func ConnectXdagWallet() int32 {
addr, err := xdagoUtils.AddressFromStorage()
if err != nil {
xlog.Error(err)
return -5
return -128
} else if len(addr) < 1 {
xlog.Error("wallet address not found")
return -6
return -256
} else if len(addr) == 1 {
XdagAddress = addr[0]
} else {
xlog.Info(addr)
OldAddresses = AddressWithBalance(addr)
if len(OldAddresses) == 0 {
xlog.Error("check old addresses balance failed")
return -7
return -512
} else if len(OldAddresses) == 1 {
XdagAddress = OldAddresses[0]
}
Expand Down

0 comments on commit 19ec8fb

Please sign in to comment.