Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warn user when sending from different account #8601

Merged
merged 8 commits into from
May 21, 2020

Conversation

brad-decker
Copy link
Contributor

@brad-decker brad-decker commented May 15, 2020

task: Warn the user when the "from" account of confirmation is different from the selected account

Trello card: https://trello.com/c/ZijoEYIz
Figma: https://www.figma.com/file/CvD7nhQVeSEB1QuSy3XhtY/oCap-%2F-Login-Per-Site?node-id=2783%3A144

Screenshot

@brad-decker brad-decker requested a review from Gudahtt May 15, 2020 17:25
@brad-decker brad-decker force-pushed the alert-account-mismatch branch 2 times, most recently from e319370 to cad1c2a Compare May 15, 2020 17:31
@brad-decker
Copy link
Contributor Author

@metamaskbot
Copy link
Collaborator

Builds ready [cad1c2a]
Page Load Metrics (623 ± 44 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint328338115
domContentLoaded3517456219244
load3527466239244
domInteractive3517446219244

@brad-decker brad-decker marked this pull request as draft May 18, 2020 20:56
@brad-decker brad-decker removed the request for review from Gudahtt May 18, 2020 20:56
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

Looks good aside from the missing checksummedSenderAddress prop!

@brad-decker brad-decker force-pushed the alert-account-mismatch branch from cad1c2a to 9028060 Compare May 19, 2020 18:19
@brad-decker brad-decker force-pushed the alert-account-mismatch branch 2 times, most recently from 6b99573 to b027e3e Compare May 19, 2020 18:24
@brad-decker brad-decker force-pushed the alert-account-mismatch branch from b027e3e to 654efd8 Compare May 19, 2020 18:32
@metamaskbot
Copy link
Collaborator

Builds ready [654efd8]
Page Load Metrics (659 ± 68 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint31110482311
domContentLoaded34291765814168
load34492065914168
domInteractive34291765714168

@brad-decker brad-decker force-pushed the alert-account-mismatch branch from 02d2cd3 to 468d5ec Compare May 20, 2020 15:44
@brad-decker brad-decker marked this pull request as ready for review May 20, 2020 16:02
@brad-decker brad-decker requested a review from a team as a code owner May 20, 2020 16:02
@metamaskbot
Copy link
Collaborator

Builds ready [468d5ec]
Page Load Metrics (626 ± 61 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint328743168
domContentLoaded37780262412761
load37980362612761
domInteractive37780262412761

@brad-decker brad-decker requested a review from Gudahtt May 20, 2020 16:06
@brad-decker
Copy link
Contributor Author

@Gudahtt could use a re-review when you have time, included a commit breakdown in the description.

@brad-decker brad-decker force-pushed the alert-account-mismatch branch from 468d5ec to 08d94ee Compare May 20, 2020 20:45
@metamaskbot
Copy link
Collaborator

Builds ready [08d94ee]
Page Load Metrics (627 ± 70 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint338643115
domContentLoaded35386362514670
load35486562714670
domInteractive35286362414670

Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

Looks great, and I really like the refactor!

However, the address "copied to clipboard" tooltip doesn't appear to be working correctly. Notice in the recording how the sender tooltip changes without clicking, then both tooltips display Copied! regardless of what I click.

Screen Recording

@rachelcope
Copy link

What about updating the copy to something a little more concise?

"Is this the correct account? It's different from the currently selected account in your wallet"

@brad-decker @Gudahtt

@brad-decker
Copy link
Contributor Author

@rekmarks -- Thanks for finding that! The current experience on develop is actually pretty broken. First off, the hover state only works half of the time for the recipient address hover... only if you go from sender tooltip active -> move the mouse over directly to the recipient. If you enter the recipient address from anywhere else it doesn't work. Furthermore, clicking it doesn't update the message to say "Copied!" because it doesn't actually trigger a set state call.

To address this:

  1. updated react-tippy
  2. added an offset prop to tooltip-v2 (because the reason for flakey hover seems to be related to the tooltip trying to open partially offscreen?)
  3. separate state for recipient and sender address copying
  4. Move more of the logic around in the split up components so that state doesn't need to be passed anywhere.

all of this is isolated to the latest commit.

@brad-decker brad-decker requested a review from rekmarks May 20, 2020 22:25
@metamaskbot
Copy link
Collaborator

Builds ready [2253f80]
Page Load Metrics (633 ± 57 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint327841126
domContentLoaded36184563211857
load36384763311857
domInteractive36184463111857

@brad-decker
Copy link
Contributor Author

@rachelcope made the copy change.

@metamaskbot
Copy link
Collaborator

Builds ready [f48f070]
Page Load Metrics (644 ± 61 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint32105512211
domContentLoaded35782164212661
load35882364412661
domInteractive35782164212661

@brad-decker brad-decker force-pushed the alert-account-mismatch branch 2 times, most recently from 91ba841 to 39c6412 Compare May 21, 2020 17:27
@brad-decker brad-decker force-pushed the alert-account-mismatch branch from 39c6412 to 8dd1e78 Compare May 21, 2020 17:41
@metamaskbot
Copy link
Collaborator

Builds ready [8dd1e78]
Page Load Metrics (673 ± 43 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint31583874
domContentLoaded3737846719043
load3757866739043
domInteractive3737836719043

package.json Outdated Show resolved Hide resolved
@brad-decker brad-decker force-pushed the alert-account-mismatch branch from 8dd1e78 to 9fefb4b Compare May 21, 2020 19:32
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

LGTM!

@brad-decker brad-decker requested a review from Gudahtt May 21, 2020 19:41
@metamaskbot
Copy link
Collaborator

Builds ready [9fefb4b]
Page Load Metrics (559 ± 60 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint3110442189
domContentLoaded34470055812560
load34670255912560
domInteractive34470055812560

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants