From 94e1a0f47717673f012aac58b1823030034c9019 Mon Sep 17 00:00:00 2001
From: Richard Bondi
Date: Wed, 13 Nov 2019 14:37:01 -0600
Subject: [PATCH] disable remove signature on broadcast
---
src/components/Spend/OutputsForm.jsx | 8 +++++--
src/components/Spend/SignatureImporter.jsx | 27 ++++++++++++----------
src/components/Spend/Transaction.jsx | 8 +++++--
3 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/src/components/Spend/OutputsForm.jsx b/src/components/Spend/OutputsForm.jsx
index 240a24bc..df2c1a63 100644
--- a/src/components/Spend/OutputsForm.jsx
+++ b/src/components/Spend/OutputsForm.jsx
@@ -40,6 +40,7 @@ class OutputsForm extends React.Component {
fee: PropTypes.string.isRequired,
feeRate: PropTypes.string.isRequired,
finalizedOutputs: PropTypes.bool.isRequired,
+ signatureImporters: PropTypes.shape({}).isRequired,
setFeeRate: PropTypes.func.isRequired,
setFee: PropTypes.func.isRequired,
addOutput: PropTypes.func.isRequired,
@@ -65,7 +66,9 @@ class OutputsForm extends React.Component {
}
scrollToTitle = () => {
- this.titleRef.current.scrollIntoView({ behavior: 'smooth' });
+ const { signatureImporters } = this.props;
+ const finalizedCount = Object.keys(signatureImporters).reduce((o, k) => o + (signatureImporters[k].finalized), 0);
+ if(finalizedCount === 0) this.titleRef.current.scrollIntoView({ behavior: 'smooth' });
}
async initialOutputState() {
@@ -338,7 +341,8 @@ function mapStateToProps(state) {
client: state.client,
},
...state.spend.transaction,
- ...state.client
+ ...state.client,
+ signatureImporters: state.spend.signatureImporters,
};
}
diff --git a/src/components/Spend/SignatureImporter.jsx b/src/components/Spend/SignatureImporter.jsx
index 6812f1f5..fe453218 100644
--- a/src/components/Spend/SignatureImporter.jsx
+++ b/src/components/Spend/SignatureImporter.jsx
@@ -15,7 +15,7 @@ import {
import {wrapText,} from "../../utils";
// Components
-import {
+import {
Card,
CardHeader,
CardContent,
@@ -25,7 +25,7 @@ import {
Button,
Grid,
Box,
- FormControl,
+ FormControl,
} from '@material-ui/core';
import Copyable from "../Copyable";
import TextSignatureImporter from "./TextSignatureImporter";
@@ -63,6 +63,7 @@ class SignatureImporter extends React.Component {
addressType: PropTypes.string.isRequired,
network: PropTypes.string.isRequired,
fee: PropTypes.string.isRequired,
+ txid: PropTypes.string.isRequired,
setName: PropTypes.func.isRequired,
setMethod: PropTypes.func.isRequired,
setBIP32Path: PropTypes.func.isRequired,
@@ -133,7 +134,7 @@ class SignatureImporter extends React.Component {
);
}
-
+
return (