diff --git a/screen/send/SendDetails.tsx b/screen/send/SendDetails.tsx index 2752fbbfc..a92291214 100644 --- a/screen/send/SendDetails.tsx +++ b/screen/send/SendDetails.tsx @@ -129,14 +129,6 @@ const SendDetails = () => { return initialFee; }, [customFee, feePrecalc, networkTransactionFees]); - useEffect(() => { - console.log('send/details - useEffect'); - if (wallet) { - setHeaderRightOptions(); - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [colors, wallet, isTransactionReplaceable, balance, addresses, isEditable, isLoading]); - useEffect(() => { // decode route params const currentAddress = addresses[scrollIndex.current]; @@ -209,6 +201,7 @@ const SendDetails = () => { } // eslint-disable-next-line react-hooks/exhaustive-deps }, [routeParams.uri, routeParams.address, routeParams.addRecipientParams]); + useEffect(() => { // check if we have a suitable wallet const suitable = wallets.filter(w => w.chain === Chain.ONCHAIN && w.allowSend()); @@ -1158,11 +1151,18 @@ const SendDetails = () => { [headerRightOnPress, isLoading, headerRightActions], ); - const setHeaderRightOptions = () => { + const setHeaderRightOptions = useCallback(() => { navigation.setOptions({ headerRight: HeaderRight, }); - }; + }, [HeaderRight, navigation]); + + useEffect(() => { + console.log('send/details - useEffect'); + if (wallet) { + setHeaderRightOptions(); + } + }, [colors, wallet, isTransactionReplaceable, balance, addresses, isEditable, isLoading, setHeaderRightOptions]); const handleRecipientsScroll = (e: NativeSyntheticEvent) => { const contentOffset = e.nativeEvent.contentOffset;