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: Hide confirmation dialog if set via setTxFlow #2233

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

usame-algan
Copy link
Member

@usame-algan usame-algan commented Jul 5, 2023

What it solves

Part of #2067

How this PR fixes it

  • Uses the browser native confirmation dialog
  • Prevents navigation if user cancels
  • Adds another option to setTxFlow to bypass confirmation dialog

How to test it

  1. Open a Safe
  2. Create new transaction
  3. Navigate away
  4. Observe no confirmation dialog
  5. Click on Send tokens
  6. Try to navigate away or close the window
  7. Observe a confirmation dialog

Screenshots

Screenshot 2023-07-05 at 15 21 33

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

@github-actions
Copy link

github-actions bot commented Jul 5, 2023

Branch preview

✅ Deploy successful!

https://confirmation_dialog--walletweb.review-wallet-web.5afe.dev

@github-actions
Copy link

github-actions bot commented Jul 5, 2023

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@usame-algan
Copy link
Member Author

We might be able to use our own confirmation dialog but we need to figure out how to do it all in one callback that we can await and throw if necessary. The previous approach of rendering another component depending on a local state didn't work with blocking the router event.

@@ -149,7 +149,6 @@ const TxNonceForm = ({ nonce, recommendedNonce }: { nonce: number; recommendedNo
readOnly,
}}
className={css.input}
title={field.value}
Copy link
Member Author

Choose a reason for hiding this comment

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

This caused MUI errors because Tooltips can't also contain a title.

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

Neat.

@usame-algan usame-algan merged commit 4e95926 into epic-tx-flow Jul 5, 2023
7 checks passed
@usame-algan usame-algan deleted the confirmation-dialog branch July 5, 2023 14:20
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants