Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Move AssetPollingProvider from Root to Nav/Main/index.js #12562

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading