on master help sign in
Fix errors in InviteWallet logic
commita0d7daba766ca57e0cc90bbd77f20f330028a473 authorFang <git@fang.io> dateTue 9 Apr 2019, 16:41 (8 years ago) parenta8ad0f6
1 file changed+6−7
src/bridge/views/InviteWallet.js+6−7
src/bridge/views/InviteWallet.js+6−7
@@ -59,13 +59,14 @@ class InviteWallet extends React.Component {
5959
6060 let point = Nothing();
6161 if (incoming.length > 0) {
62− point = Just(incoming[0]);
63− this.generateWallet(incoming[0]);
64− this.setState({ loaded: true, point: point });
62+ let pointNum = parseInt(incoming[0]);
63+ point = Just(pointNum);
64+ this.generateWallet(pointNum);
6565 if (incoming.length > 1) {
6666 //TODO notify user "...and others / ticket reusable"
6767 }
6868 }
69+ this.setState({loaded: true, point: point})
6970 })))
7071 }
7172
@@ -105,15 +106,13 @@ class InviteWallet extends React.Component {
105106
106107 const genWallet = async (point, ticket, cb) => {
107108
108− const boot = point < MIN_STAR || point > MAX_STAR;
109−
110109 const config = {
111110 ticket: ticket,
112111 seedSize: SEED_LENGTH_BYTES,
113112 ship: point,
114113 password: '',
115114 revisions: {},
116− boot: boot
115+ boot: false //TODO should this generate networking keys here already?
117116 };
118117
119118 const wallet = await kg.generateWallet(config);
@@ -165,7 +164,7 @@ class InviteWallet extends React.Component {
165164 proceed() {
166165 this.props.pushRoute(ROUTE_NAMES.INVITE_VERIFY, {
167166 ticket: this.state.wallet.value.ticket,
168− point: this.state.point.value
167+ point: parseInt(this.state.point.value)
169168 });
170169 }
171170