From ed11c2bc2dddf3eba34387dcedeb7fc811516680 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 7 Oct 2023 18:45:32 -0500 Subject: [PATCH] Move some top-level code from soapbox-load back into soapbox.tsx where it belongs --- src/containers/soapbox-load.tsx | 14 -------------- src/containers/soapbox.tsx | 12 ++++++++++++ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/containers/soapbox-load.tsx b/src/containers/soapbox-load.tsx index 3ce9d29d4..4c88f2a7e 100644 --- a/src/containers/soapbox-load.tsx +++ b/src/containers/soapbox-load.tsx @@ -5,7 +5,6 @@ import { loadInstance } from 'soapbox/actions/instance'; import { fetchMe } from 'soapbox/actions/me'; import { loadSoapboxConfig } from 'soapbox/actions/soapbox'; import LoadingScreen from 'soapbox/components/loading-screen'; -import { createGlobals } from 'soapbox/globals'; import { useAppSelector, useAppDispatch, @@ -14,19 +13,6 @@ import { } from 'soapbox/hooks'; import MESSAGES from 'soapbox/messages'; -import { checkOnboardingStatus } from '../actions/onboarding'; -import { preload } from '../actions/preload'; -import { store } from '../store'; - -// Configure global functions for developers -createGlobals(store); - -// Preload happens synchronously -store.dispatch(preload() as any); - -// This happens synchronously -store.dispatch(checkOnboardingStatus() as any); - /** Load initial data from the backend */ const loadInitial = () => { // @ts-ignore diff --git a/src/containers/soapbox.tsx b/src/containers/soapbox.tsx index 5877cbd88..e8b657d28 100644 --- a/src/containers/soapbox.tsx +++ b/src/containers/soapbox.tsx @@ -3,14 +3,26 @@ import React from 'react'; import { Provider } from 'react-redux'; import { StatProvider } from 'soapbox/contexts/stat-context'; +import { createGlobals } from 'soapbox/globals'; import { queryClient } from 'soapbox/queries/client'; +import { checkOnboardingStatus } from '../actions/onboarding'; +import { preload } from '../actions/preload'; import { store } from '../store'; import SoapboxHead from './soapbox-head'; import SoapboxLoad from './soapbox-load'; import SoapboxMount from './soapbox-mount'; +// Configure global functions for developers +createGlobals(store); + +// Preload happens synchronously +store.dispatch(preload() as any); + +// This happens synchronously +store.dispatch(checkOnboardingStatus() as any); + /** The root React node of the application. */ const Soapbox: React.FC = () => { return (