-
Notifications
You must be signed in to change notification settings - Fork 50
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
fix: Swap - confirm with password error reset #2745
Conversation
shelleyTheme | ||
title={strings.sign} | ||
onPress={() => onSubmit?.(spendingPassword)} | ||
disabled={spendingPassword?.length === 0} |
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.
maybe instead of ?.
the .
only will work here, as it should be always a string
const spendingPasswordRef = React.useRef<RNTextInput>(null) | ||
const [spendingPassword, setSpendingPassword] = React.useState( | ||
features.prefillWalletInfo ? debugWalletInfo.PASSWORD : '', | ||
) | ||
const strings = useStrings() | ||
|
||
React.useEffect(() => { | ||
setErrorData && setErrorData({errorMessage: '', errorLogs: ''}) |
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.
if it's just for clearing the error state, then maybe a onPasswordChange()
prop should be good enough. In the parent then we can do <ConfirmWithSpendingPassword onPasswordChange={() => setErrorData({errorMessage: '', errorLogs: ''})} />
Signed-off-by: Sorin Chis <[email protected]>
part of the task: https://emurgo.atlassian.net/browse/YOMO-827
demo: https://recordit.co/B8FFHUiLqw