diff --git a/components/TransactionsNavigationHeader.tsx b/components/TransactionsNavigationHeader.tsx index 244d29c6b..a4ee6da7c 100644 --- a/components/TransactionsNavigationHeader.tsx +++ b/components/TransactionsNavigationHeader.tsx @@ -218,7 +218,7 @@ const TransactionsNavigationHeader: React.FC {wallet.getPreferredBalanceUnit() === BitcoinUnit.LOCAL_CURRENCY - ? (preferredFiatCurrency?.endPointKey ?? FiatUnit.USD) + ? preferredFiatCurrency?.endPointKey ?? FiatUnit.USD : wallet.getPreferredBalanceUnit()} diff --git a/components/WalletsCarousel.tsx b/components/WalletsCarousel.tsx index c55b91eb4..489ebb5a3 100644 --- a/components/WalletsCarousel.tsx +++ b/components/WalletsCarousel.tsx @@ -248,7 +248,7 @@ export const WalletCarouselItem: React.FC = React.memo( return ( @@ -374,27 +374,31 @@ const WalletsCarousel = forwardRef((props const flatListRef = useRef>(null); - useImperativeHandle(ref, (): any => { - return { - scrollToEnd: (params: { animated?: boolean | null | undefined } | undefined) => flatListRef.current?.scrollToEnd(params), - scrollToIndex: (params: { - animated?: boolean | null | undefined; - index: number; - viewOffset?: number | undefined; - viewPosition?: number | undefined; - }) => flatListRef.current?.scrollToIndex(params), - scrollToItem: (params: { - animated?: boolean | null | undefined; - item: any; - viewOffset?: number | undefined; - viewPosition?: number | undefined; - }) => flatListRef.current?.scrollToItem(params), - scrollToOffset: (params: { animated?: boolean | null | undefined; offset: number }) => flatListRef.current?.scrollToOffset(params), - recordInteraction: () => flatListRef.current?.recordInteraction(), - flashScrollIndicators: () => flatListRef.current?.flashScrollIndicators(), - getNativeScrollRef: () => flatListRef.current?.getNativeScrollRef(), - }; - }, []); + useImperativeHandle( + ref, + (): any => { + return { + scrollToEnd: (params: { animated?: boolean | null | undefined } | undefined) => flatListRef.current?.scrollToEnd(params), + scrollToIndex: (params: { + animated?: boolean | null | undefined; + index: number; + viewOffset?: number | undefined; + viewPosition?: number | undefined; + }) => flatListRef.current?.scrollToIndex(params), + scrollToItem: (params: { + animated?: boolean | null | undefined; + item: any; + viewOffset?: number | undefined; + viewPosition?: number | undefined; + }) => flatListRef.current?.scrollToItem(params), + scrollToOffset: (params: { animated?: boolean | null | undefined; offset: number }) => flatListRef.current?.scrollToOffset(params), + recordInteraction: () => flatListRef.current?.recordInteraction(), + flashScrollIndicators: () => flatListRef.current?.flashScrollIndicators(), + getNativeScrollRef: () => flatListRef.current?.getNativeScrollRef(), + }; + }, + [], + ); const onScrollToIndexFailed = (error: { averageItemLength: number; index: number }): void => { console.debug('onScrollToIndexFailed'); diff --git a/screen/send/SendDetails.tsx b/screen/send/SendDetails.tsx index 225c574e2..b9b6899fb 100644 --- a/screen/send/SendDetails.tsx +++ b/screen/send/SendDetails.tsx @@ -110,7 +110,7 @@ const SendDetails = () => { const [dumb, setDumb] = useState(false); const { isEditable } = routeParams; // if utxo is limited we use it to calculate available balance - const balance: number = utxo ? utxo.reduce((prev, curr) => prev + curr.value, 0) : (wallet?.getBalance() ?? 0); + const balance: number = utxo ? utxo.reduce((prev, curr) => prev + curr.value, 0) : wallet?.getBalance() ?? 0; const allBalance = formatBalanceWithoutSuffix(balance, BitcoinUnit.BTC, true); // if cutomFee is not set, we need to choose highest possible fee for wallet balance diff --git a/screen/transactions/TransactionDetails.tsx b/screen/transactions/TransactionDetails.tsx index 9374b519e..045e3e479 100644 --- a/screen/transactions/TransactionDetails.tsx +++ b/screen/transactions/TransactionDetails.tsx @@ -139,7 +139,7 @@ const TransactionDetails = () => { // okay, this txid _was_ with someone using payment codes, so we show the label edit dialog // and load user-defined alias for the pc if any - setCounterpartyLabel(counterpartyMetadata ? (counterpartyMetadata[foundPaymentCode]?.label ?? '') : ''); + setCounterpartyLabel(counterpartyMetadata ? counterpartyMetadata[foundPaymentCode]?.label ?? '' : ''); setIsCounterpartyLabelVisible(true); setPaymentCode(foundPaymentCode); }