kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Move some top-level code from soapbox-load back into soapbox.tsx where it belongs
rodzic
76578c64c5
commit
ed11c2bc2d
|
@ -5,7 +5,6 @@ import { loadInstance } from 'soapbox/actions/instance';
|
||||||
import { fetchMe } from 'soapbox/actions/me';
|
import { fetchMe } from 'soapbox/actions/me';
|
||||||
import { loadSoapboxConfig } from 'soapbox/actions/soapbox';
|
import { loadSoapboxConfig } from 'soapbox/actions/soapbox';
|
||||||
import LoadingScreen from 'soapbox/components/loading-screen';
|
import LoadingScreen from 'soapbox/components/loading-screen';
|
||||||
import { createGlobals } from 'soapbox/globals';
|
|
||||||
import {
|
import {
|
||||||
useAppSelector,
|
useAppSelector,
|
||||||
useAppDispatch,
|
useAppDispatch,
|
||||||
|
@ -14,19 +13,6 @@ import {
|
||||||
} from 'soapbox/hooks';
|
} from 'soapbox/hooks';
|
||||||
import MESSAGES from 'soapbox/messages';
|
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 */
|
/** Load initial data from the backend */
|
||||||
const loadInitial = () => {
|
const loadInitial = () => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|
|
@ -3,14 +3,26 @@ import React from 'react';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
|
|
||||||
import { StatProvider } from 'soapbox/contexts/stat-context';
|
import { StatProvider } from 'soapbox/contexts/stat-context';
|
||||||
|
import { createGlobals } from 'soapbox/globals';
|
||||||
import { queryClient } from 'soapbox/queries/client';
|
import { queryClient } from 'soapbox/queries/client';
|
||||||
|
|
||||||
|
import { checkOnboardingStatus } from '../actions/onboarding';
|
||||||
|
import { preload } from '../actions/preload';
|
||||||
import { store } from '../store';
|
import { store } from '../store';
|
||||||
|
|
||||||
import SoapboxHead from './soapbox-head';
|
import SoapboxHead from './soapbox-head';
|
||||||
import SoapboxLoad from './soapbox-load';
|
import SoapboxLoad from './soapbox-load';
|
||||||
import SoapboxMount from './soapbox-mount';
|
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. */
|
/** The root React node of the application. */
|
||||||
const Soapbox: React.FC = () => {
|
const Soapbox: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
|
|
Ładowanie…
Reference in New Issue