From abbea74db448f1aa5dcb7a7979a071d2278e7d62 Mon Sep 17 00:00:00 2001 From: Ivan Vershigora Date: Thu, 28 May 2020 12:53:14 +0300 Subject: [PATCH] FIX: errors with route.params --- screen/send/psbtWithHardwareWallet.js | 4 ++-- screen/wallets/import.js | 5 +++-- screen/wallets/transactions.js | 3 --- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/screen/send/psbtWithHardwareWallet.js b/screen/send/psbtWithHardwareWallet.js index dbb2f59e2..cd20da331 100644 --- a/screen/send/psbtWithHardwareWallet.js +++ b/screen/send/psbtWithHardwareWallet.js @@ -87,8 +87,8 @@ export default class PsbtWithHardwareWallet extends Component { } static getDerivedStateFromProps(nextProps, prevState) { - const deepLinkPSBT = nextProps.props.route.params.deepLinkPSBT; - const txhex = nextProps.props.route.params.txhex; + const deepLinkPSBT = nextProps.route.params.deepLinkPSBT; + const txhex = nextProps.route.params.txhex; if (deepLinkPSBT) { try { let Tx = prevState.fromWallet.combinePsbt( diff --git a/screen/wallets/import.js b/screen/wallets/import.js index a94ef4c06..5e923edba 100644 --- a/screen/wallets/import.js +++ b/screen/wallets/import.js @@ -20,8 +20,9 @@ const { width } = Dimensions.get('window'); const WalletsImport = () => { const [isToolbarVisibleForAndroid, setIsToolbarVisibleForAndroid] = useState(false); - const { label } = useRoute().params; - const [importText, setImportText] = useState(label || ''); + const route = useRoute(); + const label = (route.params && route.params.label) || ''; + const [importText, setImportText] = useState(label); const navigation = useNavigation(); useEffect(() => { diff --git a/screen/wallets/transactions.js b/screen/wallets/transactions.js index 1de2c0155..53f01bea3 100644 --- a/screen/wallets/transactions.js +++ b/screen/wallets/transactions.js @@ -46,9 +46,6 @@ const LocalQRCode = require('@remobile/react-native-qrcode-local-image'); export default class WalletTransactions extends Component { static navigationOptions = ({ navigation, route }) => { - // route.params.isLoading - console.log('route.params.isLoading123321', route.params.isLoading); - // return {} return { headerRight: () => (