Merge branch 'master' into bstack

This commit is contained in:
Marcos Rodriguez Velez 2024-09-05 16:25:02 -04:00
commit 19e82c56b1
8 changed files with 33 additions and 37 deletions

View File

@ -45,11 +45,10 @@ const MenuElements = () => {
if (reloadTransactionsMenuActionFunction && typeof reloadTransactionsMenuActionFunction === 'function') {
reloadTransactionsMenuActionFunction();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
}, [reloadTransactionsMenuActionFunction]);
useEffect(() => {
console.log('MenuElements: useEffect');
console.debug('MenuElements: useEffect');
if (walletsInitialized) {
eventEmitter?.addListener('openSettings', openSettings);
eventEmitter?.addListener('addWalletMenuAction', addWalletMenuAction);
@ -62,8 +61,7 @@ const MenuElements = () => {
eventEmitter?.removeAllListeners('importWalletMenuAction');
eventEmitter?.removeAllListeners('reloadTransactionsMenuAction');
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [walletsInitialized]);
}, [addWalletMenuAction, importWalletMenuAction, openSettings, reloadTransactionsMenuElementsFunction, walletsInitialized]);
return null;
};

View File

@ -181,7 +181,7 @@ const TransactionsNavigationHeader: React.FC<TransactionsNavigationHeaderProps>
style={styles.lineaderGradient}
{...WalletGradient.linearGradientProps(wallet.type)}
>
<Image source={imageSource} defaultSource={imageSource} style={styles.chainIcon} />
<Image source={imageSource} style={styles.chainIcon} />
<Text testID="WalletLabel" numberOfLines={1} style={styles.walletLabel} selectable>
{wallet.getLabel()}
@ -218,7 +218,7 @@ const TransactionsNavigationHeader: React.FC<TransactionsNavigationHeaderProps>
<TouchableOpacity style={styles.walletPreferredUnitView} onPress={changeWalletBalanceUnit}>
<Text style={styles.walletPreferredUnitText}>
{wallet.getPreferredBalanceUnit() === BitcoinUnit.LOCAL_CURRENCY
? preferredFiatCurrency?.endPointKey ?? FiatUnit.USD
? (preferredFiatCurrency?.endPointKey ?? FiatUnit.USD)
: wallet.getPreferredBalanceUnit()}
</Text>
</TouchableOpacity>

View File

@ -248,7 +248,7 @@ export const WalletCarouselItem: React.FC<WalletCarouselItemProps> = React.memo(
return (
<Animated.View
style={[
isLargeScreen || !horizontal ? [iStyles.rootLargeDevice, customStyle] : customStyle ?? { ...iStyles.root, width: itemWidth },
isLargeScreen || !horizontal ? [iStyles.rootLargeDevice, customStyle] : (customStyle ?? { ...iStyles.root, width: itemWidth }),
{ opacity, transform: [{ scale: scaleValue }] },
]}
>
@ -264,7 +264,7 @@ export const WalletCarouselItem: React.FC<WalletCarouselItemProps> = React.memo(
>
<View style={[iStyles.shadowContainer, { backgroundColor: colors.background, shadowColor: colors.shadowColor }]}>
<LinearGradient colors={WalletGradient.gradientsFor(item.type)} style={iStyles.grad}>
<Image defaultSource={image} source={image} style={iStyles.image} />
<Image source={image} style={iStyles.image} />
<Text style={iStyles.br} />
{!isPlaceHolder && (
<>
@ -374,31 +374,27 @@ const WalletsCarousel = forwardRef<FlatListRefType, WalletsCarouselProps>((props
const flatListRef = useRef<FlatList<any>>(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');

View File

@ -441,7 +441,7 @@ lane :update_release_notes do |options|
'it' => release_notes_text, # Italian
'ja' => release_notes_text, # Japanese
'ms' => release_notes_text, # Malay
'nb-NO' => release_notes_text, # Norwegian
'nb' => release_notes_text, # Norwegian
'pl' => release_notes_text, # Polish
'pt-BR' => release_notes_text, # Portuguese (Brazil)
'pt-PT' => release_notes_text, # Portuguese (Portugal)

View File

@ -108,7 +108,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

View File

@ -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);
}

View File

@ -97,6 +97,7 @@ const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
}, [getTransactions, limit, pageSize]);
const refreshTransactions = useCallback(async () => {
console.debug('refreshTransactions, ', wallet?.getLabel());
if (!wallet || isElectrumDisabled || isLoading) return;
setIsLoading(true);
let smthChanged = false;

View File

@ -410,6 +410,7 @@ const WalletsList: React.FC = () => {
}, [copyFromClipboard, onBarScanned, routeName]);
const onRefresh = useCallback(() => {
console.debug('WalletsList onRefresh');
refreshTransactions(true, false);
// Optimized for Mac option doesn't like RN Refresh component. Menu Elements now handles it for macOS
}, [refreshTransactions]);