-
Notifications
You must be signed in to change notification settings - Fork 105
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
feat: add disconnect account approval step #1101
Conversation
@@ -10,17 +10,12 @@ export const ApproveConnection: React.FC = () => { | |||
const requester = useRequester(); | |||
const params = useQuery(); | |||
const interfaceOrigin = params.get("interfaceOrigin"); | |||
const interfaceTabId = params.get("interfaceTabId"); |
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.
interfaceTabId
wasn't used anymore, it was replaced by popupTabId
directly on the service
const resolver = this.getResolver(tabId); | ||
if (resolver) { | ||
resolver.reject(new Error("Window closed")); | ||
this.removeResolver(tabId); |
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.
return popupTabId; | ||
}; | ||
|
||
private launchApprovalPopup = async <T>( |
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.
launchApprovalPopup
now combines the same pattern we have in all functions:
- Create the url
- Open the popup
- Return the resolver promise
- Plus: when the promise is resolved or rejected, it's also removed from the
resolverMap
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.
Very nice!
Add the disconnection account approval step
This PR also combine e create some methods for the Approvals service to manage the popup easier, the main one is
launchApprovalPopup
which takes a typed route and custom params. And it'll remove the popup resolver from the map once they are resolved or rejected, or when the popup is removed/closed by the userScreen.Recording.2024-09-12.at.19.37.00.mov