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: support onCancel #122
Conversation
🦋 Changeset detectedLatest commit: 456b2bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
if (data.cancel) { | ||
options.onCancel?.(); | ||
} else { |
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.
This implementation works, altering the value of what data
and conditionally handling whether the cancel prop is there.
Given we're handling success/fail states, however, maybe we could consider cancel
the error state of a the promise?
704beed
to
48221fd
Compare
48221fd
to
456b2bc
Compare
Description
This PR adds an
onCancel
callback function to a transaction. It also adds a boolean on the tx payload to check if the callback function should be run.Ex.
onCancel
will be called when a user closes/cancels a transaction window.stacks-web-wallet
:Issue: leather-wallet/extension#959
PR: leather-wallet/extension#1175
Type of Change
Does this introduce a breaking change?
No.
Are documentation updates required?
No.
Testing information
TBD.
Checklist
yarn lerna run test
passes