Skip to content

Commit

Permalink
feature(catalyst): reset values after registration
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss committed Aug 30, 2024
1 parent d84671b commit e4d4543
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useCatalyst} from '@yoroi/staking'
import {useTheme} from '@yoroi/theme'
import * as React from 'react'
import {ScrollView, StyleSheet} from 'react-native'
import {InteractionManager, ScrollView, StyleSheet} from 'react-native'
import {SafeAreaView} from 'react-native-safe-area-context'

import {Button, Checkbox} from '../../../../components'
Expand All @@ -20,7 +20,7 @@ export const QrCode = () => {
const strings = useStrings()
const styles = useStyles()
const [checked, setChecked] = React.useState(false)
const {votingKeyEncrypted} = useCatalyst()
const {votingKeyEncrypted, reset} = useCatalyst()
const navigateTo = useNavigateTo()

if (votingKeyEncrypted === null) throw new Error('votingKeyEncrypted cannot be null')
Expand All @@ -30,6 +30,10 @@ export const QrCode = () => {

const onNext = () => {
navigateTo.txHistory()

InteractionManager.runAfterInteractions(() => {
reset()
})
}

return (
Expand Down

0 comments on commit e4d4543

Please sign in to comment.