Skip to content

Conversation

@wachunei
Copy link
Member

@wachunei wachunei commented Jul 9, 2025

Description

This PR refactors the send email method into the new promise style method call.

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

@metamaskbot metamaskbot added the team-ramp issues related to Ramp features label Jul 9, 2025
@wachunei wachunei added the QA Passed QA testing has been completed and passed label Jul 9, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 9, 2025

@wachunei wachunei marked this pull request as ready for review July 9, 2025 16:40
@wachunei wachunei requested a review from a team as a code owner July 9, 2025 16:40
@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: aed1bac
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/89f10a51-57a5-4318-9066-053bdb70fa3c

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Loading State Timing and Error Persistence Issues

The isLoading state is set prematurely before email validation, causing a brief, incorrect loading state when an invalid email is entered and no API call is made. Additionally, API errors are not cleared on subsequent submission attempts if the input text remains unchanged, leading to stale error messages persisting during the loading state.

app/components/UI/Ramp/Deposit/Views/EnterEmail/EnterEmail.tsx#L80-L103

const handleSubmit = useCallback(async () => {
try {
setIsLoading(true);
if (validateEmail(email)) {
setValidationError(false);
await submitEmail();
navigation.navigate(
...createOtpCodeNavDetails({
quote,
email,
paymentMethodId,
cryptoCurrencyChainId,
}),
);
} else {
setValidationError(true);
}
} catch (e) {
setError(strings('deposit.enter_email.error'));
Logger.error(e as Error, 'Error submitting email');
} finally {
setIsLoading(false);
}

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@wachunei wachunei added this pull request to the merge queue Jul 9, 2025
Merged via the queue into main with commit 02a598b Jul 9, 2025
62 of 67 checks passed
@wachunei wachunei deleted the fix/deposit-enter-email-error branch July 9, 2025 18:09
@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2025
@metamaskbot metamaskbot added the release-7.52.0 Issue or pull request that will be included in release 7.52.0 label Jul 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

QA Passed QA testing has been completed and passed release-7.52.0 Issue or pull request that will be included in release 7.52.0 team-ramp issues related to Ramp features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants