on master help sign in
- set networkSeedCache after successful setKeys transaction
commit39b597527c74dfd0dbe359db1bdd7b88cf658e02 authorChris Johnson <chris@cjohnson.io> dateWed 3 Apr 2019, 20:48 (8 years ago) parent5fed045
2 files changed+10−24
src/bridge/components/StatelessTransaction.js+7−1 src/bridge/views/SetKeys.js+3−23
src/bridge/components/StatelessTransaction.js+7−1
@@ -89,7 +89,13 @@ class StatelessTransaction extends React.Component {
8989 .then(sent => {
9090 props.setTxnHashCursor(sent)
9191 props.popRoute()
92− props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION)
92+
93+ if (props.networkSeed) {
94+ props.setNetworkSeedCache(props.networkSeed)
95+ props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION, {promptKeyfile: true})
96+ } else {
97+ props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION)
98+ }
9399 })
94100 .catch(err => {
95101 this.setState({ txError: err })
src/bridge/views/SetKeys.js+3−23
@@ -109,28 +109,6 @@ class SetKeys extends React.Component {
109109 this.setState({ networkSeed })
110110 }
111111
112− downloadKeyfile(networkSeed) {
113− const { pointCache } = this.props
114− const { pointCursor } = this.props
115−
116− const point = pointCursor.matchWith({
117− Just: (pt) => pt.value,
118− Nothing: () => {
119− throw BRIDGE_ERROR.MISSING_POINT
120− }
121− })
122−
123− const pointDetails =
124− point in pointCache
125− ? pointCache[point]
126− : (() => { throw BRIDGE_ERROR.MISSING_POINT })()
127−
128− const revision = parseInt(pointDetails.keyRevisionNumber)
129− const keyfile = genKey(networkSeed, point, revision)
130− let blob = new Blob([keyfile], {type:"text/plain;charset=utf-8"});
131− saveAs(blob, `${ob.patp(point).slice(1)}-${revision}.key`)
132− }
133−
134112 createUnsignedTxn() {
135113 const { state, props } = this
136114
@@ -231,7 +209,9 @@ class SetKeys extends React.Component {
231209 pushRoute={props.pushRoute}
232210 // Tx
233211 canGenerate={ canGenerate }
234− createUnsignedTxn={this.createUnsignedTxn} />
212+ createUnsignedTxn={this.createUnsignedTxn}
213+ networkSeed={ state.networkSeed }
214+ setNetworkSeedCache={ props.setNetworkSeedCache } />
235215
236216 </Col>
237217 </Row>