fix #1888 ether amount not updated in /send suggestion on json rpc error in release apk only

This commit is contained in:
Goran Jovic 2017-09-21 12:40:05 +02:00 committed by Roman Volosovskyi
parent cf59e6b1eb
commit 191e5bcc0b
1 changed files with 22 additions and 8 deletions

View File

@ -38,6 +38,7 @@ status.defineSubscription(
) )
function amountParameterBox(params, context) { function amountParameterBox(params, context) {
if (!params["bot-db"]) { if (!params["bot-db"]) {
params["bot-db"] = {}; params["bot-db"] = {};
} }
@ -68,12 +69,24 @@ function amountParameterBox(params, context) {
var sliderValue = params["bot-db"]["sliderValue"] || 0; var sliderValue = params["bot-db"]["sliderValue"] || 0;
status.setDefaultDb({ try {
transaction: txData,
calculatedFee: calculateFee(sliderValue, txData), status.setDefaultDb({
feeExplanation: getFeeExplanation(sliderValue), transaction: txData,
sliderValue: sliderValue calculatedFee: calculateFee(sliderValue, txData),
}); feeExplanation: getFeeExplanation(sliderValue),
sliderValue: sliderValue
});
}catch (err){
status.setDefaultDb({
transaction: txData,
calculatedFee: "0",
feeExplanation: "",
sliderValue: sliderValue
});
}
return { return {
title: I18n.t('send_title'), title: I18n.t('send_title'),
@ -245,6 +258,7 @@ function amountParameterBox(params, context) {
)] )]
) )
}; };
} }
var paramsSend = [ var paramsSend = [
@ -335,7 +349,7 @@ function validateSend(params, context) {
) )
}; };
} }
var fee = calculateFee( var fee = calculateFee(
params["bot-db"]["sliderValue"], params["bot-db"]["sliderValue"],
{ {
@ -373,7 +387,7 @@ function handleSend(params, context) {
web3.eth.sendTransaction(data, function(error, hash) { web3.eth.sendTransaction(data, function(error, hash) {
if (error) { if (error) {
status.sendSignal("handler-result", { status.sendSignal("handler-result", {
status: "failed", status: "failed",
error: { error: {
markup: status.components.validationMessage( markup: status.components.validationMessage(
I18n.t('validation_tx_title'), I18n.t('validation_tx_title'),