FIX: Mac crash

This commit is contained in:
Marcos Rodriguez Velez 2024-02-15 18:35:21 -04:00
parent 5605353857
commit b183f891ec
No known key found for this signature in database
GPG Key ID: 6030B2F48CCE86D7
4 changed files with 12 additions and 13 deletions

View File

@ -43,7 +43,7 @@ const MenuElements = () => {
const reloadTransactionsMenuElementsFunction = useCallback(() => {
reloadTransactionsMenuActionFunction();
}, [reloadTransactionsMenuActionFunction]);
},[reloadTransactionsMenuActionFunction]);
useEffect(() => {
console.log('MenuElements: useEffect');
@ -59,14 +59,8 @@ const MenuElements = () => {
eventEmitter?.removeAllListeners('importWalletMenuAction');
eventEmitter?.removeAllListeners('reloadTransactionsMenuAction');
};
}, [
addWalletMenuAction,
importWalletMenuAction,
openSettings,
reloadTransactionsMenuActionFunction,
reloadTransactionsMenuElementsFunction,
walletsInitialized,
]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [addWalletMenuAction, importWalletMenuAction, openSettings, reloadTransactionsMenuActionFunction, walletsInitialized]);
return <></>;
};

View File

@ -180,14 +180,14 @@
// Implement the functionality for adding a wallet
[EventEmitter.sharedInstance importWalletMenuAction];
NSLog(@"Add Wallet action performed");
NSLog(@"Import Wallet action performed");
}
- (void)reloadTransactionsAction:(UIKeyCommand *)keyCommand {
// Implement the functionality for adding a wallet
[EventEmitter.sharedInstance reloadTransactionsMenuAction];
NSLog(@"Add Wallet action performed");
NSLog(@"Reload Transactions action performed");
}

View File

@ -11,6 +11,7 @@ import {
useWindowDimensions,
findNodeHandle,
I18nManager,
InteractionManager,
} from 'react-native';
import { BlueHeaderDefaultMain } from '../../BlueComponents';
import WalletsCarousel from '../../components/WalletsCarousel';
@ -74,7 +75,9 @@ const WalletsList = () => {
useCallback(() => {
verifyBalance();
setSelectedWalletID(undefined);
setReloadTransactionsMenuActionFunction(onRefresh);
InteractionManager.runAfterInteractions(() => {
setReloadTransactionsMenuActionFunction(() => onRefresh);
});
return () => {
setReloadTransactionsMenuActionFunction(() => {});
};

View File

@ -511,7 +511,9 @@ const WalletTransactions = ({ navigation }) => {
useFocusEffect(
useCallback(() => {
setReloadTransactionsMenuActionFunction(refreshTransactions);
InteractionManager.runAfterInteractions(() => {
setReloadTransactionsMenuActionFunction(() => refreshTransactions);
});
return () => {
setReloadTransactionsMenuActionFunction(undefined);
};