From ab83fe750ecbcdf081aaa69663910f2bf892f926 Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Wed, 31 Jul 2019 11:41:35 +0100 Subject: [PATCH] Add screen for reused address --- i18n/ui/lbm-ui_en-US.po | 110 ++++++++++++++++++++++++--------- lib/brain.js | 6 ++ ui/css/text-content-sizes.scss | 1 + ui/html/address-reuse.html | 29 +++++++++ ui/images/address-reuse.svg | 42 +++++++++++++ ui/src/app.js | 1 + 6 files changed, 160 insertions(+), 29 deletions(-) create mode 100644 ui/html/address-reuse.html create mode 100644 ui/images/address-reuse.svg diff --git a/i18n/ui/lbm-ui_en-US.po b/i18n/ui/lbm-ui_en-US.po index 7b29279e2..85872c60d 100644 --- a/i18n/ui/lbm-ui_en-US.po +++ b/i18n/ui/lbm-ui_en-US.po @@ -1,3 +1,19 @@ +#: On screen: address-reuse +msgid "Address already used" +msgstr "Address already used" + +#: On screen: address-reuse +msgid "It looks like you've used this address already." +msgstr "It looks like you've used this address already." + +#: On screen: address-reuse +msgid "For both your privacy and safety against scams, plase generate a new one from your wallet and scan that one instead." +msgstr "For both your privacy and safety against scams, plase generate a new one from your wallet and scan that one instead." + +#: On screen: address-reuse +msgid "Start over" +msgstr "Start over" + #: On screen: are-you-sure msgid "Are you sure?" msgstr "Are you sure?" @@ -130,14 +146,30 @@ msgstr "Dispensing..." msgid "Please wait while we dispense your cash." msgstr "Please wait while we dispense your cash." -#: On screen: dispensing +#: On screen: dispensing-collect msgid "All set" msgstr "All set" -#: On screen: dispensing +#: On screen: dispensing-collect msgid "Please remove your cash from the tray." msgstr "Please remove your cash from the tray." +#: On screen: dispensing-partial-collect +msgid "Collect bills" +msgstr "Collect bills" + +#: On screen: dispensing-partial-collect +msgid "To continue dispensing, take your cash from the tray." +msgstr "To continue dispensing, take your cash from the tray." + +#: On screen: facephoto +msgid "Look at the dot" +msgstr "Look at the dot" + +#: On screen: facephoto +msgid "This should just take a second." +msgstr "This should just take a second." + #: On screen: facephoto-permission msgid "May we?" msgstr "May we?" @@ -154,15 +186,39 @@ msgstr "Yes, take photo" msgid "No, finish up" msgstr "No, finish up" -#: On screen: facephoto +#: On screen: facephoto-failed-number +msgid "Try again?" +msgstr "Try again?" + +#: On screen: facephoto-failed-number +msgid "Looks like we didn't get a good shot." +msgstr "Looks like we didn't get a good shot." + +#: On screen: facephoto-failed-number +msgid "Shall we try another photo?" +msgstr "Shall we try another photo?" + +#: On screen: facephoto-failed-number +msgid "Yes, try again" +msgstr "Yes, try again" + +#: On screen: facephoto-failed-number +msgid "No, send coins" +msgstr "No, send coins" + +#: On screen: facephoto-failed-number +msgid "No, cancel" +msgstr "No, cancel" + +#: On screen: facephoto_retry msgid "Look into the camera" msgstr "Look into the camera" -#: On screen: facephoto +#: On screen: facephoto_retry msgid "We didn't get a good picture of you." msgstr "We didn't get a good picture of you." -#: On screen: facephoto +#: On screen: facephoto_retry msgid "Please look into the camera located above the screen." msgstr "Please look into the camera located above the screen." @@ -190,6 +246,22 @@ msgstr "Apologies. We've reached our mandated per-user limit." msgid "OK" msgstr "OK" +#: On screen: id-verification +msgid "ID verification" +msgstr "ID verification" + +#: On screen: id-verification +msgid "If you'd like to make a larger purchase, we'll need to make sure you're you by asking for you to scan your ID." +msgstr "If you'd like to make a larger purchase, we'll need to make sure you're you by asking for you to scan your ID." + +#: On screen: id-verification +msgid "Would you like to insert more bills?" +msgstr "Would you like to insert more bills?" + +#: On screen: id-verification +msgid "Yes, verify ID" +msgstr "Yes, verify ID" + #: On screen: insert-bills msgid "Wallet successfully validated!" msgstr "Wallet successfully validated!" @@ -386,30 +458,10 @@ msgstr "Send coins" msgid "Sending your coins..." msgstr "Sending your coins..." -#: On screen: sms-verification -msgid "ID verification" -msgstr "ID verification" - #: On screen: sms-verification msgid "If you'd like to make a larger purchase we need to ask for your mobile phone number. We'll then send you an SMS code." msgstr "If you'd like to make a larger purchase we need to ask for your mobile phone number. We'll then send you an SMS code." -#: On screen: sms-verification -msgid "Would you like to insert more bills?" -msgstr "Would you like to insert more bills?" - -#: On screen: sms-verification -msgid "Yes, verify ID" -msgstr "Yes, verify ID" - -#: On screen: sms-verification -msgid "No, send coins" -msgstr "No, send coins" - -#: On screen: sms-verification -msgid "No, cancel" -msgstr "No, cancel" - #: On screen: suspicious-address msgid "Suspicious address" msgstr "Suspicious address" @@ -418,10 +470,6 @@ msgstr "Suspicious address" msgid "This address may be associated with a deceptive offer or a prohibited group. Please make sure you're using an address from your own wallet." msgstr "This address may be associated with a deceptive offer or a prohibited group. Please make sure you're using an address from your own wallet." -#: On screen: suspicious-address -msgid "Start over" -msgstr "Start over" - #: On screen: booting msgid "Booting up..." msgstr "Booting up..." @@ -662,6 +710,10 @@ msgstr "This could take a few seconds." msgid "Verifying photo card..." msgstr "Verifying photo card..." +#: On screen: verifying-facephoto +msgid "Verifying photo..." +msgstr "Verifying photo..." + #: On screen: wifi msgid "Select a WiFi network" msgstr "Select a WiFi network" diff --git a/lib/brain.js b/lib/brain.js index 03021d9fb..b456e23d3 100644 --- a/lib/brain.js +++ b/lib/brain.js @@ -2237,6 +2237,12 @@ Brain.prototype._handleScan = function _handleScan (address) { ? Math.max(0, extraTime) : 0 + if (it.addressReuse) { + return setTimeout(() => { + this._timedState('addressReuse') + }, remaining) + } + if (it.blacklisted) { return setTimeout(() => { this._timedState('suspiciousAddress') diff --git a/ui/css/text-content-sizes.scss b/ui/css/text-content-sizes.scss index 6f5b5cb9a..945c5bb46 100644 --- a/ui/css/text-content-sizes.scss +++ b/ui/css/text-content-sizes.scss @@ -33,6 +33,7 @@ } .unpaired_state, +.address_reuse_state, .suspicious_address_state, .max_phone_retries_state, .sms_verification_state { diff --git a/ui/html/address-reuse.html b/ui/html/address-reuse.html new file mode 100644 index 000000000..0f285271b --- /dev/null +++ b/ui/html/address-reuse.html @@ -0,0 +1,29 @@ +
+
+ +
+ +
+

Address already used

+
+

+ It looks like you've used this address already. +

+

+ For both your privacy and safety against scams, + plase generate a new one from your wallet and + scan that one instead. +

+
+
+ +
+ +
+
diff --git a/ui/images/address-reuse.svg b/ui/images/address-reuse.svg new file mode 100644 index 000000000..ca50ab336 --- /dev/null +++ b/ui/images/address-reuse.svg @@ -0,0 +1,42 @@ + + + + Group 5 Copy + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ui/src/app.js b/ui/src/app.js index 8a00c54a8..0c0ff4fad 100644 --- a/ui/src/app.js +++ b/ui/src/app.js @@ -565,6 +565,7 @@ $(document).ready(function () { setupButton('photo-scan-failed-cancel', 'bye') setupButton('photo-verification-failed-ok', 'cancelIdScan') setupButton('invalid-address-try-again', 'invalidAddressTryAgain') + setupButton('address-reuse-start-over', 'idle') setupButton('suspicious-address-start-over', 'idle') setupButton('sanctions-failure-ok', 'idle')