-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add rebootReader method #629
Conversation
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.
changes lgtm with a small change request to not clear the connected reader after reboot. I tested this branch and confirmed if auto reconnect is enabled it would lose that state. I think you can just remove that clearing and rely on the existing disconnect callback handling to reset the connected reader state.
src/hooks/useStripeTerminal.tsx
Outdated
if (!response.error) { | ||
setConnectedReader(null); | ||
setDiscoveredReaders([]); | ||
} |
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.
I don't think we want to clear the connected reader. If the user enabled auto-reconnect the SDK will start attempting to reconnect when the rebooted reader disconnects. That reconnect may fail but that's OK. We should rely on the existing disconnect callbacks to clear the connected reader
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.
yes, I removed the codes and gave a test, it works well then. thanks!
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.
changes lgtm!
Summary
Add rebootReader method.
Motivation
Support rebootReader SDK method.
Testing
Documentation
Select one: