-
Notifications
You must be signed in to change notification settings - Fork 23
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: handle user cancel in transaction modal #1234
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR improves user experience by handling transaction cancellation gracefully and streamlining the offchain space settings flow. Key changes include:
- Rethrowing original errors in network verification instead of wrapping them.
- Adjusting the settings save flow to bypass the transaction modal for offchain space settings.
- Adding a new "reject" UI state in the transaction modal to visually differentiate cancelled transactions.
Reviewed Changes
File | Description |
---|---|
apps/ui/src/helpers/utils.ts | Changes error handling in network verification by rethrowing errors directly. |
apps/ui/src/views/Space/Settings.vue | Modifies the save function to handle offchain saves without displaying the transaction modal. |
apps/ui/src/components/Modal/TransactionProgress.vue | Introduces a new "reject" step with dedicated UI elements and messages for cancelled transactions. |
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
apps/ui/src/components/Modal/TransactionProgress.vue:73
- [nitpick] The default rejection subtitle 'You need to confirm the transaction to proceed' might be confusing if the transaction was cancelled intentionally. Consider updating it to clearly indicate that the transaction was cancelled by the user.
if (step.value === 'reject') {
apps/ui/src/components/Modal/TransactionProgress.vue:102
- Consider adding a comment or logging for the rejection case so that rejections can be better traced during debugging, even though they are handled by setting the 'reject' step.
if (['ACTION_REJECTED', 4001].includes(e.code)) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tAck
I can't see the vote share modal when I cast a vote. When I cancel a tx on SX I see "Transaction failed" and not "Transaction cancelled" modal. I don't think anyway we need a "Transaction cancelled" modal, instead we should show the vote modal or his previous steps if another action. |
Summary
Closes: #1181
This PR handle the transaction cancel action more gracefully by not showing an error, and just close the modal.
Also remove the transaction modal when saving offchain space settings, and handle the save directly, like for voting.
How to test