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

Start end approval flows #1394

Merged
merged 9 commits into from
Jun 9, 2023
Merged

Start end approval flows #1394

merged 9 commits into from
Jun 9, 2023

Conversation

bergarces
Copy link
Contributor

@bergarces bergarces commented May 26, 2023

Description

Adds methods to start and end an approval flow.

Changes

  • ADDED: Added startFlow and endFlow methods to ApprovalController.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation for new or updated code as appropriate (note: this will usually be JSDoc)
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@bergarces bergarces marked this pull request as ready for review May 31, 2023 07:55
@bergarces bergarces requested a review from a team as a code owner May 31, 2023 07:55
this.update((draftState) => {
draftState.pendingApprovals = {};
draftState.pendingApprovalCount = 0;
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has to do with mobile, since I couldn't find any instances of clear within the extension or snaps code.

When requesting a user approval in mobile, ApprovalController.clear() is called to remove all pending approvals.

If we don't stop it from clearing approval flows, it will also stop them in between approvals.

Other alternatives include an option in the requestUserApproval function to stop calling clear at will (defaulting to the current behaviour).

OGPoyraz
OGPoyraz previously approved these changes Jun 8, 2023
@bergarces bergarces requested a review from OGPoyraz June 9, 2023 08:20
@bergarces bergarces merged commit ac58285 into main Jun 9, 2023
@bergarces bergarces deleted the start-end-approval-flows branch June 9, 2023 08:48
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants