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

fix: display warning when sending zero tokens #21091

Conversation

sahar-fehri
Copy link
Contributor

Description

This PR display a warning when the user attempts to send zero amount in tokens/native currency.

Manual testing steps

_1. Click on any token
_2. Click Send
_3. Enter zero as amount
_4. Click next and notice the display of warning.

Screenshots/Recordings

Before

image

image

After

Sending zero ETH

image

Sending zero token (DAI)

image

Not displayed when sending amount in ETH !== 0

image

Not displayed when sending amount of tokens different than zero

image

Related issues

_Fixes #MMASSETS-44

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained:
    • What problem this PR is solving.
    • How this problem was solved.
    • How reviewers can test my changes.
  • I’ve indicated what issue this PR is linked to: Fixes #???
  • I’ve included tests if applicable.
  • I’ve documented any added code.
  • I’ve applied the right labels on the PR (see labeling guidelines).
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@sahar-fehri sahar-fehri added the team-extension-ux DEPRECATED: please use "team-wallet-ux" label instead label Sep 28, 2023
@sahar-fehri sahar-fehri requested a review from a team as a code owner September 28, 2023 12:36
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@sahar-fehri sahar-fehri force-pushed the fix/MMASSETS-44-display-warning-when-sending-zero-amount branch from 662fdd5 to 325b7a0 Compare September 28, 2023 14:01
@sahar-fehri sahar-fehri force-pushed the fix/MMASSETS-44-display-warning-when-sending-zero-amount branch 2 times, most recently from 9cadcca to dde4de7 Compare September 28, 2023 21:02
@sahar-fehri sahar-fehri force-pushed the fix/MMASSETS-44-display-warning-when-sending-zero-amount branch from dde4de7 to dabe6ba Compare September 28, 2023 21:07
@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (12c9d97) 68.49% compared to head (dabe6ba) 68.50%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #21091      +/-   ##
===========================================
+ Coverage    68.49%   68.50%   +0.01%     
===========================================
  Files         1010     1010              
  Lines        40398    40412      +14     
  Branches     10788    10797       +9     
===========================================
+ Hits         27669    27683      +14     
  Misses       12729    12729              
Files Coverage Δ
...nents/app/transaction-alerts/transaction-alerts.js 100.00% <100.00%> (ø)
...transaction-base/confirm-token-transaction-base.js 1.69% <ø> (ø)
...saction-base/confirm-transaction-base.component.js 56.60% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [dabe6ba]
Page Load Metrics (925 ± 391 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint91135120147
domContentLoaded73133108168
load841946925815391
domInteractive73133108168
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 1.18 KiB (0.01%)
  • common: 52 Bytes (0.00%)

Copy link
Contributor

@brad-decker brad-decker left a comment

Choose a reason for hiding this comment

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

Awesome :D

@sahar-fehri sahar-fehri merged commit dc01cc0 into develop Oct 2, 2023
10 checks passed
@sahar-fehri sahar-fehri deleted the fix/MMASSETS-44-display-warning-when-sending-zero-amount branch October 2, 2023 15:49
@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2023
@metamaskbot metamaskbot added the release-11.3.0 Issue or pull request that will be included in release 11.3.0 label Oct 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.3.0 Issue or pull request that will be included in release 11.3.0 team-extension-ux DEPRECATED: please use "team-wallet-ux" label instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants