Skip to content

Commit

Permalink
fix: Move AssetPollingProvider from Root to Nav/Main/index.js (#12562)
Browse files Browse the repository at this point in the history
## **Description**

Picks `AssetPollingProvider` diff from
https://github.com/MetaMask/metamask-mobile/pull/12538/files bug fix to
isolate changes.

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
gambinish authored Dec 4, 2024
1 parent 1a8b40f commit a93ef10
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
61 changes: 32 additions & 29 deletions app/components/Nav/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import {
} from '../../../util/transaction-controller';
import isNetworkUiRedesignEnabled from '../../../util/networks/isNetworkUiRedesignEnabled';
import { useConnectionHandler } from '../../../util/navigation/useConnectionHandler';
import { AssetPollingProvider } from '../../hooks/AssetPolling/AssetPollingProvider';

const Stack = createStackNavigator();

Expand Down Expand Up @@ -362,35 +363,37 @@ const Main = (props) => {

return (
<React.Fragment>
<View style={styles.flex}>
{!forceReload ? (
<MainNavigator navigation={props.navigation} />
) : (
renderLoader()
)}
<GlobalAlert />
<FadeOutOverlay />
<Notification navigation={props.navigation} />
<RampOrders />
<SwapsLiveness />
<BackupAlert
onDismiss={toggleRemindLater}
navigation={props.navigation}
/>
{renderDeprecatedNetworkAlert(
props.chainId,
props.backUpSeedphraseVisible,
)}
<SkipAccountSecurityModal
modalVisible={showRemindLaterModal}
onCancel={skipAccountModalSecureNow}
onConfirm={skipAccountModalSkip}
skipCheckbox={skipCheckbox}
toggleSkipCheckbox={toggleSkipCheckbox}
/>
<ProtectYourWalletModal navigation={props.navigation} />
<RootRPCMethodsUI navigation={props.navigation} />
</View>
<AssetPollingProvider>
<View style={styles.flex}>
{!forceReload ? (
<MainNavigator navigation={props.navigation} />
) : (
renderLoader()
)}
<GlobalAlert />
<FadeOutOverlay />
<Notification navigation={props.navigation} />
<RampOrders />
<SwapsLiveness />
<BackupAlert
onDismiss={toggleRemindLater}
navigation={props.navigation}
/>
{renderDeprecatedNetworkAlert(
props.chainId,
props.backUpSeedphraseVisible,
)}
<SkipAccountSecurityModal
modalVisible={showRemindLaterModal}
onCancel={skipAccountModalSecureNow}
onConfirm={skipAccountModalSkip}
skipCheckbox={skipCheckbox}
toggleSkipCheckbox={toggleSkipCheckbox}
/>
<ProtectYourWalletModal navigation={props.navigation} />
<RootRPCMethodsUI navigation={props.navigation} />
</View>
</AssetPollingProvider>
</React.Fragment>
);
};
Expand Down
9 changes: 3 additions & 6 deletions app/components/Views/Root/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { useAppTheme, ThemeContext } from '../../../util/theme';
import { ToastContextWrapper } from '../../../component-library/components/Toast';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { isTest } from '../../../util/test/utils';
import { AssetPollingProvider } from '../../hooks/AssetPolling/AssetPollingProvider';

/**
* Top level of the component hierarchy
Expand Down Expand Up @@ -86,11 +85,9 @@ const ConnectedRoot = () => {
<SafeAreaProvider>
<ThemeContext.Provider value={theme}>
<ToastContextWrapper>
<AssetPollingProvider>
<ErrorBoundary view="Root">
<App />
</ErrorBoundary>
</AssetPollingProvider>
<ErrorBoundary view="Root">
<App />
</ErrorBoundary>
</ToastContextWrapper>
</ThemeContext.Provider>
</SafeAreaProvider>
Expand Down

0 comments on commit a93ef10

Please sign in to comment.