From 4dd9b9326afbf0db0e0cd81e10b414561e6d860b Mon Sep 17 00:00:00 2001 From: samepant Date: Sun, 29 Aug 2021 22:03:36 -0400 Subject: [PATCH] confirmation of signing --- components/forms/TransactionSigning.js | 42 ++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/components/forms/TransactionSigning.js b/components/forms/TransactionSigning.js index aded4bc..60bfab9 100644 --- a/components/forms/TransactionSigning.js +++ b/components/forms/TransactionSigning.js @@ -5,6 +5,7 @@ import { SigningStargateClient } from "@cosmjs/stargate"; import { registry } from "@cosmjs/proto-signing"; import Button from "../inputs/Button"; +import HashView from "../dataViews/HashView"; import StackableContainer from "../layout/StackableContainer"; export default class TransactionSigning extends React.Component { @@ -16,6 +17,7 @@ export default class TransactionSigning extends React.Component { walletAccount: null, walletError: null, sigError: null, + hasSigned: false, }; } @@ -58,7 +60,10 @@ export default class TransactionSigning extends React.Component { const walletAccount = await window.keplr.getKey( process.env.NEXT_PUBLIC_CHAIN_ID ); - this.setState({ walletAccount }); + const hasSigned = this.props.signatures.some( + (sig) => sig.address === walletAccount.bech32Address + ); + this.setState({ walletAccount, hasSigned }); } catch (e) { console.log("enable err: ", e); } @@ -112,11 +117,28 @@ export default class TransactionSigning extends React.Component { render() { return ( -

Sign this transaction

- {this.state.walletAccount ? ( -