The following steps will let you prove that you control both an account and a phone number.
+ The verification code has been sent to { number }.
{ cancel }
@@ -116,7 +118,9 @@ export default class SMSVerification extends Component {
}
const { step } = this.state;
- if (step === 3) {
+ if (step === 4) {
+ return this.renderFifthStep();
+ } else if (step === 3) {
return this.renderFourthStep();
} else if (step === 2) {
return this.renderThirdStep();
@@ -140,7 +144,10 @@ export default class SMSVerification extends Component {
}
next = () => {
- this.setState({ step: this.state.step + 1, stepIsValid: false });
+ const { stepIsValid } = this.state;
+ if (stepIsValid) {
+ this.setState({ step: this.state.step + 1, stepIsValid: false });
+ }
}
renderFirstStep () {
@@ -167,6 +174,7 @@ export default class SMSVerification extends Component {
onData={ this.onData }
onSuccess={ this.onDataIsValid }
onError={ this.onDataIsInvalid }
+ nextStep={ this.next }
/>
);
}
@@ -194,7 +202,12 @@ export default class SMSVerification extends Component {
onData={ this.onData }
onSuccess={ this.onDataIsValid }
onError={ this.onDataIsInvalid }
+ nextStep={ this.next }
/>
);
}
+
+ renderFifthStep () {
+ return (
);
+ }
}
diff --git a/js/src/modals/SMSVerification/SendConfirmation/sendConfirmation.js b/js/src/modals/SMSVerification/SendConfirmation/sendConfirmation.js
index 7e7880929..4f044d51c 100644
--- a/js/src/modals/SMSVerification/SendConfirmation/sendConfirmation.js
+++ b/js/src/modals/SMSVerification/SendConfirmation/sendConfirmation.js
@@ -33,7 +33,8 @@ export default class SendConfirmation extends Component {
data: PropTypes.object.isRequired,
onData: PropTypes.func.isRequired,
onSuccess: PropTypes.func.isRequired,
- onError: PropTypes.func.isRequired
+ onError: PropTypes.func.isRequired,
+ nextStep: PropTypes.func.isRequired
}
state = {
@@ -57,7 +58,7 @@ export default class SendConfirmation extends Component {
}
if (step === 'pending') {
- return (
Waiting for authorization by the Parity Signer.
);
+ return (
The verification code will be sent to the contract. Please authorize this using the Parity Signer.
);
}
if (step === 'posted') {
@@ -68,16 +69,12 @@ export default class SendConfirmation extends Component {
);
}
- if (step === 'mined') {
- return (Waiting for authorization by the Parity Signer.
);
+ return (A verification request will be sent to the contract. Please authorize this using the Parity Signer.
);
}
if (step === 'posted') {
@@ -87,16 +88,12 @@ export default class SendRequest extends Component {
return (Requesting an SMS from the Parity server.
);
}
- if (step === 'sms-sent') {
- return (The verification code has been sent to { this.props.data.number }.
);
- }
-
return null;
}
send = () => {
const { api } = this.context;
- const { account, contract, onData, onError, onSuccess } = this.props;
+ const { account, contract, onData, onError, onSuccess, nextStep } = this.props;
const { fee, number, hasRequested } = this.props.data;
const request = contract.functions.find((fn) => fn.name === 'request');
@@ -131,6 +128,7 @@ export default class SendRequest extends Component {
.then(() => {
this.setState({ step: 'sms-sent' });
onSuccess();
+ nextStep();
})
.catch((err) => {
console.error('failed to request sms verification', err);