From e4d454327f279e471ceec378adbb54ac418055e0 Mon Sep 17 00:00:00 2001 From: Javier Bueno Date: Fri, 30 Aug 2024 16:16:25 +0200 Subject: [PATCH] feature(catalyst): reset values after registration --- .../RegisterCatalyst/useCases/ShowQrCode/ShowQrCode.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/wallet-mobile/src/features/RegisterCatalyst/useCases/ShowQrCode/ShowQrCode.tsx b/apps/wallet-mobile/src/features/RegisterCatalyst/useCases/ShowQrCode/ShowQrCode.tsx index 4db0f5648d..b63a82204d 100644 --- a/apps/wallet-mobile/src/features/RegisterCatalyst/useCases/ShowQrCode/ShowQrCode.tsx +++ b/apps/wallet-mobile/src/features/RegisterCatalyst/useCases/ShowQrCode/ShowQrCode.tsx @@ -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' @@ -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') @@ -30,6 +30,10 @@ export const QrCode = () => { const onNext = () => { navigateTo.txHistory() + + InteractionManager.runAfterInteractions(() => { + reset() + }) } return (