Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

verification: don't request a code twice #4221

Merged
merged 3 commits into from
Jan 20, 2017
Merged

Conversation

derhuerst
Copy link
Contributor

Better UX for the verification process. Users haven't been able to close the verification modal/page as soon as they had requested a code.

@derhuerst derhuerst added A0-pleasereview 🤓 Pull request needs code review. M7-ui labels Jan 19, 2017
@derhuerst derhuerst requested a review from gavofyork January 19, 2017 13:45
export const hasReceivedCode = (email, address, isTestnet = false) => {
const port = isTestnet ? 28443 : 18443;
const query = stringify({ email, address });
return fetch(`https://email-verification.parity.io:${port}/?` + query, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Blank line before
  2. Why are we using template strings & ES6-style string +'s in one?

export const hasReceivedCode = (number, address, isTestnet = false) => {
const port = isTestnet ? 8443 : 443;
const query = stringify({ number, address });
return fetch(`https://sms-verification.parity.io:${port}/?` + query, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per above comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from above, will change. Although I disagree 😁

@@ -21,7 +21,7 @@ import SMSVerificationABI from '~/contracts/abi/sms-verification.json';
import VerificationStore, {
LOADING, QUERY_DATA, QUERY_CODE, POSTED_CONFIRMATION, DONE
} from './store';
import { isServerRunning, postToServer } from '../../3rdparty/sms-verification';
import { isServerRunning, hasReceivedCode, postToServer } from '../../3rdparty/sms-verification';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are touching the line, always prefer ~/3rdparty to ../../3rdparty

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Just adapted it without paying attention.

const port = isTestnet ? 28443 : 18443;
const query = stringify({ email, address });
return fetch(`https://email-verification.parity.io:${port}/?` + query, {
mode: 'cors', cache: 'no-store'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer multi-key objects to have a single entry per line.

@jacogr jacogr added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jan 20, 2017
@gavofyork gavofyork merged commit 1f77c43 into master Jan 20, 2017
@gavofyork gavofyork deleted the jr-verification-ux branch January 20, 2017 12:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants