From d8dcdbceafa1cd880b75c5757178a43cb704ad7d Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Thu, 6 Jun 2024 13:11:08 -0400 Subject: [PATCH] FIX: correct popToTop --- screen/PlausibleDeniability.tsx | 6 ++---- screen/lnd/lnurlAuth.js | 2 -- screen/lnd/lnurlPaySuccess.js | 6 +++--- screen/settings/EncryptStorage.tsx | 9 ++------- screen/transactions/CPFP.js | 3 ++- screen/transactions/RBFBumpFee.js | 4 ++-- screen/transactions/RBFCancel.js | 4 ++-- screen/wallets/details.js | 3 ++- 8 files changed, 15 insertions(+), 22 deletions(-) diff --git a/screen/PlausibleDeniability.tsx b/screen/PlausibleDeniability.tsx index 6d6074d09..4b4642416 100644 --- a/screen/PlausibleDeniability.tsx +++ b/screen/PlausibleDeniability.tsx @@ -1,5 +1,3 @@ -import { useNavigation } from '@react-navigation/native'; -import { NativeStackNavigationProp } from '@react-navigation/native-stack'; import React, { useReducer } from 'react'; import { ScrollView } from 'react-native'; import triggerHapticFeedback, { HapticFeedbackTypes } from '../blue_modules/hapticFeedback'; @@ -9,6 +7,7 @@ import Button from '../components/Button'; import prompt from '../helpers/prompt'; import loc from '../loc'; import { useStorage } from '../hooks/context/useStorage'; +import { popToTop } from '../NavigationService'; // Action Types const SET_LOADING = 'SET_LOADING'; @@ -39,7 +38,6 @@ function reducer(state: State, action: Action): State { const PlausibleDeniability: React.FC = () => { const { cachedPassword, isPasswordInUse, createFakeStorage, resetWallets } = useStorage(); const [state, dispatch] = useReducer(reducer, initialState); - const navigation = useNavigation>>(); const handleOnCreateFakeStorageButtonPressed = async () => { dispatch({ type: SET_LOADING, payload: true }); @@ -66,7 +64,7 @@ const PlausibleDeniability: React.FC = () => { resetWallets(); triggerHapticFeedback(HapticFeedbackTypes.NotificationSuccess); presentAlert({ message: loc.plausibledeniability.success }); - navigation.popToTop(); + popToTop(); } catch { dispatch({ type: SET_LOADING, payload: false }); } diff --git a/screen/lnd/lnurlAuth.js b/screen/lnd/lnurlAuth.js index ebe25ba7f..179d9a90e 100644 --- a/screen/lnd/lnurlAuth.js +++ b/screen/lnd/lnurlAuth.js @@ -173,6 +173,4 @@ const styles = StyleSheet.create({ LnurlAuth.navigationOptions = navigationStyle({ title: '', - closeButton: true, - closeButtonFunc: ({ navigation }) => navigation.getParent().popToTop(), }); diff --git a/screen/lnd/lnurlPaySuccess.js b/screen/lnd/lnurlPaySuccess.js index 607c3c399..ac4af78b2 100644 --- a/screen/lnd/lnurlPaySuccess.js +++ b/screen/lnd/lnurlPaySuccess.js @@ -1,14 +1,14 @@ +import React, { Component } from 'react'; import AsyncStorage from '@react-native-async-storage/async-storage'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; import { Image, Linking, ScrollView, StyleSheet, View } from 'react-native'; - import { BlueButtonLink, BlueCard, BlueLoading, BlueSpacing20, BlueSpacing40, BlueText } from '../../BlueComponents'; import Lnurl from '../../class/lnurl'; import Button from '../../components/Button'; import SafeArea from '../../components/SafeArea'; import loc from '../../loc'; import { SuccessView } from '../send/success'; +import { popToTop } from '../../NavigationService'; export default class LnurlPaySuccess extends Component { constructor(props) { @@ -119,7 +119,7 @@ export default class LnurlPaySuccess extends Component { ) : (