FIX: Crash on scan in wallets import when closing the view

This commit is contained in:
Marcos Rodriguez 2020-01-19 17:03:16 -05:00 committed by Overtorment
parent a3954ecc4b
commit a7e0766612

View file

@ -15,7 +15,7 @@ const ScanQRCode = ({
launchedBy = useNavigationParam('launchedBy'),
}) => {
const [isLoading, setIsLoading] = useState(false);
const { navigate } = useNavigation();
const { navigate, goBack } = useNavigation();
const onBarCodeRead = ret => {
if (!isLoading && !cameraPreviewIsPaused) {
@ -62,7 +62,7 @@ const ScanQRCode = ({
right: 16,
top: 64,
}}
onPress={() => navigate(launchedBy)}
onPress={() => launchedBy ? navigate(launchedBy) : goBack(null) }
>
<Image style={{ alignSelf: 'center' }} source={require('../../img/close-white.png')} />
</TouchableOpacity>