Page MenuHomePhabricator

D11555.id38801.diff
No OneTemporary

D11555.id38801.diff

diff --git a/web/app.react.js b/web/app.react.js
--- a/web/app.react.js
+++ b/web/app.react.js
@@ -3,13 +3,11 @@
import 'basscss/css/basscss.min.css';
import './theme.css';
import { config as faConfig } from '@fortawesome/fontawesome-svg-core';
-import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import classnames from 'classnames';
import _isEqual from 'lodash/fp/isEqual.js';
import * as React from 'react';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
-import { WagmiProvider } from 'wagmi';
import {
fetchEntriesActionTypes,
@@ -38,10 +36,7 @@
import { getConfig, registerConfig } from 'lib/utils/config.js';
import { useDispatch } from 'lib/utils/redux-utils.js';
import { infoFromURL } from 'lib/utils/url-utils.js';
-import {
- AlchemyENSCacheProvider,
- getWagmiConfig,
-} from 'lib/utils/wagmi-utils.js';
+import { AlchemyENSCacheProvider } from 'lib/utils/wagmi-utils.js';
import QrCodeLogin from './account/qr-code-login.react.js';
import AppThemeWrapper from './app-theme-wrapper.react.js';
@@ -123,16 +118,6 @@
// Start initializing the shared worker immediately
void getCommSharedWorker();
-const queryClient = new QueryClient();
-
-const wagmiConfig = getWagmiConfig([
- 'injected',
- 'rainbow',
- 'metamask',
- 'coinbase',
- 'walletconnect',
-]);
-
type BaseProps = {
+location: {
+pathname: string,
@@ -231,25 +216,21 @@
<DndProvider backend={HTML5Backend}>
<EditModalProvider>
<MenuProvider>
- <WagmiProvider config={wagmiConfig}>
- <QueryClientProvider client={queryClient}>
- <AlchemyENSCacheProvider>
- <TooltipProvider>
- <MessageSearchStateProvider>
- <ChatMentionContextProvider>
- <FocusHandler />
- <VisibilityHandler />
- <PolicyAcknowledgmentHandler />
- <PushNotificationsHandler />
- <InviteLinkHandler />
- <InviteLinksRefresher />
- {content}
- </ChatMentionContextProvider>
- </MessageSearchStateProvider>
- </TooltipProvider>
- </AlchemyENSCacheProvider>
- </QueryClientProvider>
- </WagmiProvider>
+ <AlchemyENSCacheProvider>
+ <TooltipProvider>
+ <MessageSearchStateProvider>
+ <ChatMentionContextProvider>
+ <FocusHandler />
+ <VisibilityHandler />
+ <PolicyAcknowledgmentHandler />
+ <PushNotificationsHandler />
+ <InviteLinkHandler />
+ <InviteLinksRefresher />
+ {content}
+ </ChatMentionContextProvider>
+ </MessageSearchStateProvider>
+ </TooltipProvider>
+ </AlchemyENSCacheProvider>
</MenuProvider>
</EditModalProvider>
</DndProvider>
diff --git a/web/root.js b/web/root.js
--- a/web/root.js
+++ b/web/root.js
@@ -1,5 +1,6 @@
// @flow
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import localforage from 'localforage';
import * as React from 'react';
import { Provider } from 'react-redux';
@@ -8,6 +9,7 @@
import { composeWithDevTools } from 'redux-devtools-extension/logOnlyInProduction.js';
import { persistReducer, persistStore } from 'redux-persist';
import thunk from 'redux-thunk';
+import { WagmiProvider } from 'wagmi';
import IntegrityHandler from 'lib/components/integrity-handler.react.js';
import KeyserverConnectionsHandler from 'lib/components/keyserver-connections-handler.js';
@@ -15,6 +17,7 @@
import ReportHandler from 'lib/components/report-handler.react.js';
import { CallKeyserverEndpointProvider } from 'lib/keyserver-conn/call-keyserver-endpoint-provider.react.js';
import { reduxLoggerMiddleware } from 'lib/utils/action-logger.js';
+import { getWagmiConfig } from 'lib/utils/wagmi-utils.js';
import App from './app.react.js';
import { DBOpsHandler } from './components/db-ops-handler.react.js';
@@ -46,24 +49,38 @@
synchronizeStoreWithOtherTabs(store);
const persistor = persistStore(store);
+const queryClient = new QueryClient();
+
+const wagmiConfig = getWagmiConfig([
+ 'injected',
+ 'rainbow',
+ 'metamask',
+ 'coinbase',
+ 'walletconnect',
+]);
+
const RootProvider = (): React.Node => (
<Provider store={store}>
<ErrorBoundary>
- <CallKeyserverEndpointProvider>
- <InitialReduxStateGate persistor={persistor}>
- <IdentityServiceContextProvider>
- <Router history={history.getHistoryObject()}>
- <Route path="*" component={App} />
- </Router>
- <KeyserverConnectionsHandler socketComponent={Socket} />
- <PrekeysHandler />
- <SQLiteDataHandler />
- <IntegrityHandler />
- <ReportHandler canSendReports={true} />
- <DBOpsHandler />
- </IdentityServiceContextProvider>
- </InitialReduxStateGate>
- </CallKeyserverEndpointProvider>
+ <WagmiProvider config={wagmiConfig}>
+ <QueryClientProvider client={queryClient}>
+ <CallKeyserverEndpointProvider>
+ <InitialReduxStateGate persistor={persistor}>
+ <IdentityServiceContextProvider>
+ <Router history={history.getHistoryObject()}>
+ <Route path="*" component={App} />
+ </Router>
+ <KeyserverConnectionsHandler socketComponent={Socket} />
+ <PrekeysHandler />
+ <SQLiteDataHandler />
+ <IntegrityHandler />
+ <ReportHandler canSendReports={true} />
+ <DBOpsHandler />
+ </IdentityServiceContextProvider>
+ </InitialReduxStateGate>
+ </CallKeyserverEndpointProvider>
+ </QueryClientProvider>
+ </WagmiProvider>
</ErrorBoundary>
</Provider>
);

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 9, 11:34 PM (12 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2831145
Default Alt Text
D11555.id38801.diff (6 KB)

Event Timeline