Skip to content

Start end approval flows#1394

Merged
bergarces merged 9 commits into
mainfrom
start-end-approval-flows
Jun 9, 2023
Merged

Start end approval flows#1394
bergarces merged 9 commits into
mainfrom
start-end-approval-flows

Conversation

@bergarces
Copy link
Copy Markdown
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
Copy Markdown
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
Comment thread packages/approval-controller/src/ApprovalController.ts Outdated
Comment thread packages/approval-controller/src/ApprovalController.ts Outdated
Comment thread packages/approval-controller/src/ApprovalController.test.ts
@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
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