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

feat(A.Next): add useQRCodeString for RN #4886

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

calebpollman
Copy link
Member

Description of changes

Add useQRCodeString and unit tests for Totp configuration in RN Authenticator

Issue #, if available

Description of how you validated changes

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@calebpollman calebpollman requested a review from a team as a code owner January 4, 2024 23:56
Copy link

changeset-bot bot commented Jan 4, 2024

⚠️ No Changeset found

Latest commit: 22977dd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

'^uuid$': '<rootDir>/../../node_modules/uuid',
},
modulePaths: ['<rootDir>/node_modules/'],
coverageThreshold: {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

Copy link
Contributor

@thaddmt thaddmt left a comment

Choose a reason for hiding this comment

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

LGTM other than some clarifying comments

});

return () => {
ignore = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this because the hook can be unmounted before the async toQRCodeString completes?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep 😅

import { isFunction } from '@aws-amplify/ui';

export type UseQRCodeStringParams = {
onError?: (err: string) => void;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a general pattern or philosophy on whether it should be onError?: (error: Error) => void; or onError?: (err: string) => void;?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question 😄 We do not, for internal hooks personally have been leaning towards (errorMessage: string) => void for ease of use in client code but don't feel particularly strongly either way

@calebpollman calebpollman merged commit 3bcdfe5 into main Jan 9, 2024
38 checks passed
@calebpollman calebpollman deleted the authenticator-next/add-use-qrcode-string branch January 9, 2024 21:08
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