-
Notifications
You must be signed in to change notification settings - Fork 337
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: Add loading states to WC #3441
Conversation
Branch previewβ Deploy successful! |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
π¦ Next.js Bundle Analysis for safe-wallet-webThis analysis was generated by the Next.js Bundle Analysis action. π€ π Global Bundle Size Decreased
DetailsThe global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster. Any third party scripts you have added directly to your app using the If you want further insight into what is behind the changes, give @next/bundle-analyzer a try! |
Coverage report
Show files with reduced coverage π»
Test suite run success1411 tests passing in 195 suites. Report generated by π§ͺjest coverage report action from 4b6d6fd |
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.
π
While working on #3395 I realised it would be nicer to only have one loading state and keep it inside the context. When a user approves a session, the reject button should be disabled and vice versa. If there was one loading state e.g. with an indicator that its an "approval" or a "rejection" or a "disconnection" we could disable all other action buttons. I will implement it in this PR since it would otherwise revert most of the changes done here. Sorry for the back and forth! |
@francovenica could you test again? The only difference should be that now when pressing "Approve", the "Reject" button should be disabled and when pressing "Reject", the "Approve" button should be disabled. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
Yes, works fine for me. |
What it solves
Resolves #3200
How this PR fixes it
disconnect
,reject
andapprove
onDisconnect
,onReject
andonApprove
handler to the components where they are used instead of prop drilling themOther changes:
π‘ These aim to reduce complexity and improve the UX. We should discuss if we want to keep them or not. π‘
handleBeforeUnload
call as there is no error and no such handling in the example app. Reloading the page during an approval doesn't show any errors either, just an "Unknown" pairing but no active session. Using the same uri again establishes a session and updates the "Unknown" pairing which is expected.WcConnectionState
and associated logic. Switching back and forth with the dialogs when approving/rejecting takes the user out of the current context which is confusing imo. We should rather keep the user in the current dialog and display a loading state there.How to test it
We should check that after pasting the URI into the input field and reloading the page before pressing reject and approve doesn't cause any errors.
Screenshots
Checklist