Skip to content

Commit

Permalink
quick fix: more aggressively hide the cancel button (keybase#18424)
Browse files Browse the repository at this point in the history
* quick fix: more aggressively hide the cancel button

* fix error case
  • Loading branch information
xgess authored Jul 17, 2019
1 parent 6c39c81 commit 9cdf069
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions go/stellar/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,13 @@ func transformPaymentRelay(mctx libkb.MetaContext, acctID stellar1.AccountID, p
loc.ToType = stellar1.ParticipantType_STELLAR
loc.ToUsername = ""
loc.ToAccountName = ""
if p.Claim.ToPaymentStatus() == stellar1.PaymentStatus_CANCELED {
claimStatus := p.Claim.ToPaymentStatus()
if claimStatus != stellar1.PaymentStatus_ERROR {
// if there's a claim and it's not currently erroring, then hide the
// `cancel` button
loc.ShowCancel = false
}
if claimStatus == stellar1.PaymentStatus_CANCELED {
// canceled payment. blank out toAssertion and stow in originalToAssertion
// set delta to what it would have been had the payment completed
loc.ToAssertion = ""
Expand All @@ -334,7 +340,6 @@ func transformPaymentRelay(mctx libkb.MetaContext, acctID stellar1.AccountID, p
}
if p.Claim.TxStatus == stellar1.TransactionStatus_SUCCESS {
// If the claim succeeded, the relay payment is done.
loc.ShowCancel = false
loc.StatusDetail = ""
} else {
claimantUsername, err := lookupUsername(mctx, p.Claim.To.Uid)
Expand Down

0 comments on commit 9cdf069

Please sign in to comment.