on master help sign in
Fix errors in InviteWallet logic
a0d7dabFang
src/bridge/views/InviteWallet.js+6−7
@@ -59,13 +59,14 @@ class InviteWallet extends React.Component {
59
59
60 let point = Nothing();
60 let point = Nothing();
61 if (incoming.length > 0) {
61 if (incoming.length > 0) {
62+ let pointNum = parseInt(incoming[0]);
62− point = Just(incoming[0]);
63+ point = Just(pointNum);
63− this.generateWallet(incoming[0]);
64+ this.generateWallet(pointNum);
64− this.setState({ loaded: true, point: point });
65 if (incoming.length > 1) {
65 if (incoming.length > 1) {
66 //TODO notify user "...and others / ticket reusable"
66 //TODO notify user "...and others / ticket reusable"
67 }
67 }
68 }
68 }
69+ this.setState({loaded: true, point: point})
69 })))
70 })))
70 }
71 }
71
72
@@ -105,15 +106,13 @@ class InviteWallet extends React.Component {
105
106
106 const genWallet = async (point, ticket, cb) => {
107 const genWallet = async (point, ticket, cb) => {
107
108
108− const boot = point < MIN_STAR || point > MAX_STAR;
109−
110 const config = {
109 const config = {
111 ticket: ticket,
110 ticket: ticket,
112 seedSize: SEED_LENGTH_BYTES,
111 seedSize: SEED_LENGTH_BYTES,
113 ship: point,
112 ship: point,
114 password: '',
113 password: '',
115 revisions: {},
114 revisions: {},
116− boot: boot
115+ boot: false //TODO should this generate networking keys here already?
117 };
116 };
118
117
119 const wallet = await kg.generateWallet(config);
118 const wallet = await kg.generateWallet(config);
@@ -165,7 +164,7 @@ class InviteWallet extends React.Component {
165 proceed() {
164 proceed() {
166 this.props.pushRoute(ROUTE_NAMES.INVITE_VERIFY, {
165 this.props.pushRoute(ROUTE_NAMES.INVITE_VERIFY, {
167 ticket: this.state.wallet.value.ticket,
166 ticket: this.state.wallet.value.ticket,
168− point: this.state.point.value
167+ point: parseInt(this.state.point.value)
169 });
168 });
170 }
169 }
171
170