Tx sender: mobile improvements, history box

This commit is contained in:
mDuo13
2019-04-24 19:40:38 -07:00
parent 269d889fcf
commit 71ee136cb0
3 changed files with 61 additions and 20 deletions

View File

@@ -1147,6 +1147,31 @@ a.current {
width: 25px;height:25px;
}
#connection-status-item.active {
background-color: #2BCB96;
border-color: #2BCB96;
}
#tx-sender-history ul {
overflow: auto;
height: 220px;
border: 1px solid rgba(0, 0, 0, 0.125)
}
#tx-sender-history .list-group-item {
font-size: small;
color: #6c757d;
}
.page-tx-sender .input-group .form-control {
flex: 1 1 20%;
}
.bootstrap-growl {
max-width: 90vw !important;
overflow: hidden;
}
/* Print styles ------------------------------------------------------------- */
@media print {

View File

@@ -20,6 +20,18 @@ const set_up_tx_sender = async function() {
})
}
function logTx(txtype, hash, result) {
let li = "wtf"
// Future feature: link hash to a testnet txsplainer
if (result === "tesSUCCESS") {
li = '<li class="list-group-item fade-in p-1 text-muted"><i class="fa fa-check-circle"></i> '+txtype+": "+hash+'</li>'
} else {
li = '<li class="list-group-item fade-in p-1 list-group-item-danger"><i class="fa fa-times-circle"></i> '+txtype+": "+hash+'</li>'
}
$("#tx-sender-history ul").prepend(li)
}
//////////////////////////////////////////////////////////////////////////////
// Connection / Setup
//////////////////////////////////////////////////////////////////////////////
@@ -43,7 +55,7 @@ const set_up_tx_sender = async function() {
// so this won't go over JavaScript's
// 64-bit double precision
$("#balance-item").text(xrp_balance) + " drops"
$("#balance-item").text(xrp_balance)
$(".sending-address-item").text(sending_address)
}
@@ -127,6 +139,7 @@ const set_up_tx_sender = async function() {
maxLedgerVersion: prepared.instructions.maxLedgerVersion
}
let sign_response
try {
// Sign, submit
sign_response = api.sign(prepared.txJSON, use_secret)
@@ -147,11 +160,13 @@ const set_up_tx_sender = async function() {
if (final_result === "tesSUCCESS") {
if (!silent) {
successNotif(tx_object.TransactionType+" tx succeeded (hash: "+sign_response.id+")")
logTx(tx_object.TransactionType, sign_response.id, final_result)
}
} else {
if (!silent) {
errorNotif(tx_object.TransactionType+" tx failed w/ code "+final_result+
" (hash: "+sign_response.id+")")
logTx(tx_object.TransactionType, sign_response.id, final_result)
}
}
update_xrp_balance()
@@ -315,9 +330,7 @@ const set_up_tx_sender = async function() {
currency: pp_sending_currency,
issuer: pp_issuer_address
},
Flags: 0x80020000 // tfPartialPayment | tfFullyCanonicalSig
/*,
Paths: use_path*/
Flags: api.txFlags.Payment.PartialPayment | api.txFlags.Universal.FullyCanonicalSig
})
$("#send_partial_payment .loader").hide()
$("#send_partial_payment button").attr("disabled",false)