mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-04 04:13:49 +01:00
FIX: InteractionManager had no cancel on return
This commit is contained in:
parent
1384c8453f
commit
bdf1ffa2e5
3 changed files with 7 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
import React, { useEffect, useContext } from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import * as NavigationService from '../NavigationService';
|
||||
import { BlueStorageContext } from '../blue_modules/storage-context';
|
||||
import { useStorage } from '../blue_modules/storage-context';
|
||||
import { NativeEventEmitter, NativeModules } from 'react-native';
|
||||
import HandOffComponent from './HandOffComponent.ios';
|
||||
|
||||
|
@ -16,7 +16,7 @@ const { EventEmitter } = NativeModules;
|
|||
const eventEmitter = new NativeEventEmitter(EventEmitter);
|
||||
|
||||
const HandOffComponentListener: React.FC = () => {
|
||||
const { walletsInitialized } = useContext(BlueStorageContext); // Assuming 'walletsInitialized' is stored in context
|
||||
const { walletsInitialized } = useStorage();
|
||||
|
||||
useEffect(() => {
|
||||
if (!walletsInitialized) {
|
||||
|
|
|
@ -137,12 +137,13 @@ const WalletsList: React.FC = () => {
|
|||
|
||||
useFocusEffect(
|
||||
useCallback(() => {
|
||||
InteractionManager.runAfterInteractions(() => {
|
||||
const task = InteractionManager.runAfterInteractions(() => {
|
||||
setReloadTransactionsMenuActionFunction(() => onRefresh);
|
||||
verifyBalance();
|
||||
setSelectedWalletID(undefined);
|
||||
});
|
||||
return () => {
|
||||
task.cancel();
|
||||
setReloadTransactionsMenuActionFunction(() => {});
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
|
|
@ -459,10 +459,11 @@ const WalletTransactions = ({ navigation }) => {
|
|||
|
||||
useFocusEffect(
|
||||
useCallback(() => {
|
||||
InteractionManager.runAfterInteractions(() => {
|
||||
const task = InteractionManager.runAfterInteractions(() => {
|
||||
setReloadTransactionsMenuActionFunction(() => refreshTransactions);
|
||||
});
|
||||
return () => {
|
||||
task.cancel();
|
||||
setReloadTransactionsMenuActionFunction(() => {});
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
|
Loading…
Add table
Reference in a new issue