Update lndCreateInvoice.js

This commit is contained in:
Marcos Rodriguez Velez 2024-03-24 16:46:56 -04:00
parent cf29590356
commit eff16acc30
No known key found for this signature in database
GPG key ID: 6030B2F48CCE86D7

View file

@ -16,7 +16,7 @@ import {
import { Icon } from 'react-native-elements'; import { Icon } from 'react-native-elements';
import { useFocusEffect, useNavigation, useRoute } from '@react-navigation/native'; import { useFocusEffect, useNavigation, useRoute } from '@react-navigation/native';
import { BlueAlertWalletExportReminder, BlueDismissKeyboardInputAccessory, BlueLoading } from '../../BlueComponents'; import { BlueDismissKeyboardInputAccessory, BlueLoading } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle'; import navigationStyle from '../../components/navigationStyle';
import AmountInput from '../../components/AmountInput'; import AmountInput from '../../components/AmountInput';
import * as NavigationService from '../../NavigationService'; import * as NavigationService from '../../NavigationService';
@ -32,6 +32,7 @@ import { useTheme } from '../../components/themes';
import Button from '../../components/Button'; import Button from '../../components/Button';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback'; import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import { btcToSatoshi, fiatToBTC, satoshiToBTC } from '../../blue_modules/currency'; import { btcToSatoshi, fiatToBTC, satoshiToBTC } from '../../blue_modules/currency';
import { presentWalletExportReminder } from '../../helpers/presentWalletExportReminder';
const LNDCreateInvoice = () => { const LNDCreateInvoice = () => {
const { wallets, saveToDisk, setSelectedWalletID } = useContext(BlueStorageContext); const { wallets, saveToDisk, setSelectedWalletID } = useContext(BlueStorageContext);
@ -117,9 +118,11 @@ const LNDCreateInvoice = () => {
if (wallet.current.getUserHasSavedExport()) { if (wallet.current.getUserHasSavedExport()) {
renderReceiveDetails(); renderReceiveDetails();
} else { } else {
BlueAlertWalletExportReminder({ presentWalletExportReminder()
onSuccess: () => renderReceiveDetails(), .then(() => {
onFailure: () => { renderReceiveDetails();
})
.catch(() => {
getParent().pop(); getParent().pop();
NavigationService.navigate('WalletExportRoot', { NavigationService.navigate('WalletExportRoot', {
screen: 'WalletExport', screen: 'WalletExport',
@ -127,7 +130,6 @@ const LNDCreateInvoice = () => {
walletID, walletID,
}, },
}); });
},
}); });
} }
} else { } else {