Skip to content

Commit

Permalink
remove account syncing action
Browse files Browse the repository at this point in the history
  • Loading branch information
tommasini committed Nov 13, 2024
1 parent 91cf754 commit 191599b
Showing 1 changed file with 33 additions and 24 deletions.
57 changes: 33 additions & 24 deletions app/components/Views/Wallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ import {
import { ButtonVariants } from '../../../component-library/components/Buttons/Button';
//import { useListNotifications } from '../../../util/notifications/hooks/useNotifications';
import { useAccountName } from '../../hooks/useAccountName';
import { useAccountSyncing } from '../../../util/notifications/hooks/useAccountSyncing';
//import { useAccountSyncing } from '../../../util/notifications/hooks/useAccountSyncing';

import { PortfolioBalance } from '../../UI/Tokens/TokenList/PortfolioBalance';
import useCheckNftAutoDetectionModal from '../../hooks/useCheckNftAutoDetectionModal';
Expand Down Expand Up @@ -151,6 +151,10 @@ interface WalletProps {
hideNftFetchingLoadingIndicator: () => void;
}

const Wallet2 = () => {

Check failure on line 154 in app/components/Views/Wallet/index.tsx

View workflow job for this annotation

GitHub Actions / scripts (lint)

'Wallet2' is assigned a value but never used

Check failure on line 154 in app/components/Views/Wallet/index.tsx

View workflow job for this annotation

GitHub Actions / scripts (lint)

Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`
return <View style={{ flex: 1, backgroundColor: 'red' }}></View>;

Check failure on line 155 in app/components/Views/Wallet/index.tsx

View workflow job for this annotation

GitHub Actions / scripts (lint)

Color literal: { backgroundColor: 'red' }

Check failure on line 155 in app/components/Views/Wallet/index.tsx

View workflow job for this annotation

GitHub Actions / scripts (lint)

Inline style: { flex: 1, backgroundColor: 'red' }
};

/**
* Main view for the wallet
*/
Expand All @@ -165,7 +169,7 @@ const Wallet = ({
const appState = useRef(AppState.currentState);
const { navigate } = useNavigation();
// const { listNotifications } = useListNotifications();
const { dispatchAccountSyncing } = useAccountSyncing();
//const { dispatchAccountSyncing } = useAccountSyncing();
const walletRef = useRef(null);
const theme = useTheme();
const { toastRef } = useContext(ToastContext);
Expand Down Expand Up @@ -418,31 +422,36 @@ const Wallet = ({
// Layout effect when component/view is visible
// - fetches notifications
// - dispatches account syncing
useLayoutEffect(() => {
const handleAppStateChange = (nextAppState: AppStateStatus) => {
if (
appState.current?.match(/inactive|background/) &&
nextAppState === 'active'
) {
// listNotifications();
dispatchAccountSyncing();
}
useLayoutEffect(
() => {
const handleAppStateChange = (nextAppState: AppStateStatus) => {
if (
appState.current?.match(/inactive|background/) &&
nextAppState === 'active'
) {
// listNotifications();
// dispatchAccountSyncing();
}

appState.current = nextAppState;
};
appState.current = nextAppState;
};

const subscription = AppState.addEventListener(
'change',
handleAppStateChange,
);
const subscription = AppState.addEventListener(
'change',
handleAppStateChange,
);

// listNotifications();
dispatchAccountSyncing();
// listNotifications();
// dispatchAccountSyncing();

return () => {
subscription.remove();
};
}, [dispatchAccountSyncing]);
return () => {
subscription.remove();
};
},
[
/* dispatchAccountSyncing */
],
);

useEffect(() => {
navigation.setOptions(
Expand Down Expand Up @@ -693,5 +702,5 @@ const mapDispatchToProps = (dispatch: any) => ({
hideNftFetchingLoadingIndicator: () =>
dispatch(hideNftFetchingLoadingIndicatorAction()),
});

//export default Wallet2;
export default connect(mapStateToProps, mapDispatchToProps)(Wallet);

0 comments on commit 191599b

Please sign in to comment.