on master help sign in
- Fix wallet generation states
commit91ebedebfedd7707a498c696893716e74507f9ac authorChris Johnson <chris@cjohnson.io> dateMon 22 Apr 2019, 06:16 (8 years ago) parent86b0be0
3 files changed+16−9
src/bridge/components/Passport.js+13−3 src/bridge/lib/invite.js+2−5 src/bridge/views/InviteTicket.js+1−1
src/bridge/components/Passport.js+13−3
@@ -59,14 +59,22 @@ class Passport extends React.Component {
5959 }
6060
6161 getWalletStates() {
62− let hideWalletStates = this.props.walletStates.includes(WALLET_STATES.TRANSACTIONS)
62+ let { walletStates } = this.props
63+
64+ let hideWalletStates = walletStates.includes(WALLET_STATES.TRANSACTIONS)
6365 if (hideWalletStates) return null
6466
65− let stateElems = this.props.walletStates.map(state => {
67+ let stateElems = walletStates.map(state => {
68+ if (state === WALLET_STATES.DOWNLOADED) return null
69+
70+ let lastIndex = walletStates.indexOf(state) === walletStates.length - 1
71+
6672 return (
6773 <div className="flex justify-between">
6874 <div className="text-mono text-sm lh-6 green-dark">{state}</div>
69− <div className="text-700 text-sm lh-6 green-dark">✓</div>
75+ {(!lastIndex) &&
76+ <div className="text-700 text-sm lh-6 green-dark">✓</div>
77+ }
7078 </div>
7179 )
7280 })
@@ -111,6 +119,8 @@ class Passport extends React.Component {
111119 let paperReady = this.state.paper && this.props.walletStates.includes(WALLET_STATES.PAPER_READY)
112120 let downloadColor = paperReady ? 'green' : 'black'
113121
122+ window.curTime = (new Date()).getTime()
123+
114124 return (
115125 <div>
116126 <div className="passport-border">
src/bridge/lib/invite.js+2−5
@@ -24,8 +24,8 @@ const INVITE_STAGES = {
2424const WALLET_STATES = {
2525 UNLOCKING: "Unlocking invite wallet",
2626 GENERATING: "Generating your wallet",
27− GENERATED: "Wallet generation complete",
28− PAPER_READY: "Paper collateral generated",
27+ RENDERING: "Creating paper collateral",
28+ PAPER_READY: "Download your wallet",
2929 DOWNLOADED: "Wallet downloaded",
3030 TRANSACTIONS: "Sending transactions"
3131}
@@ -80,10 +80,7 @@ async function generateWallet(point) {
8080 }
8181
8282 const ticket = await makeTicket(point);
83−
8483 const wallet = await genWallet(point, ticket);
85− console.log('got wallet', wallet);
86− console.log('should start rendering now');
8784 return wallet;
8885}
8986
src/bridge/views/InviteTicket.js+1−1
@@ -112,7 +112,7 @@ class InviteTicket extends React.Component {
112112 this.setState({
113113 realPoint: point,
114114 realWallet: Just(wallet),
115− walletStates: this.state.walletStates.concat(WALLET_STATES.GENERATED)
115+ walletStates: this.state.walletStates.concat(WALLET_STATES.RENDERING)
116116 })
117117 }
118118