import { AffineContext } from '@affine/core/components/context'; import { WindowsAppControls } from '@affine/core/components/pure/header/windows-app-controls'; import { AppContainer } from '@affine/core/desktop/components/app-container'; import { router } from '@affine/core/desktop/router'; import { I18nProvider } from '@affine/core/modules/i18n'; import createEmotionCache from '@affine/core/utils/create-emotion-cache'; import { CacheProvider } from '@emotion/react'; import { FrameworkRoot, getCurrentStore } from '@toeverything/infra'; import { Suspense } from 'react'; import { RouterProvider } from 'react-router-dom'; import { setupEffects } from './effects'; import { DesktopLanguageSync } from './language-sync'; import { DesktopThemeSync } from './theme-sync'; const { frameworkProvider } = setupEffects(); const desktopWhiteList = [ '/open-app/signin-redirect', '/open-app/url', '/upgrade-success', '/ai-upgrade-success', '/share', '/oauth', '/magic-link', ]; if ( !BUILD_CONFIG.isElectron && BUILD_CONFIG.debug && desktopWhiteList.every(path => !location.pathname.startsWith(path)) ) { document.body.innerHTML = `

Don't run electron entry in browser.

`; throw new Error('Wrong distribution'); } const cache = createEmotionCache(); const future = { v7_startTransition: true, } as const; export function App() { return ( } router={router} future={future} /> {environment.isWindows && (
)}
); }