mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
@@ -6,6 +6,7 @@ import {
|
||||
AppTabsHeader,
|
||||
configureAppTabsHeaderModule,
|
||||
} from '@affine/core/modules/app-tabs-header';
|
||||
import { configureDesktopApiModule } from '@affine/core/modules/desktop-api';
|
||||
import { configureI18nModule, I18nProvider } from '@affine/core/modules/i18n';
|
||||
import { configureElectronStateStorageImpls } from '@affine/core/modules/storage';
|
||||
import { SplitViewFallback } from '@affine/core/modules/workbench/view/split-view/split-view';
|
||||
@@ -23,6 +24,7 @@ configureElectronStateStorageImpls(framework);
|
||||
configureAppTabsHeaderModule(framework);
|
||||
configureAppSidebarModule(framework);
|
||||
configureI18nModule(framework);
|
||||
configureDesktopApiModule(framework);
|
||||
const frameworkProvider = framework.provider();
|
||||
|
||||
export function App() {
|
||||
|
||||
@@ -1,28 +1,16 @@
|
||||
import './setup';
|
||||
|
||||
import { apis, events } from '@affine/electron-api';
|
||||
import { events } from '@affine/electron-api';
|
||||
import { StrictMode } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
|
||||
import { App } from './app';
|
||||
|
||||
async function main() {
|
||||
const handleMaximized = (maximized: boolean | undefined) => {
|
||||
document.documentElement.dataset.maximized = String(maximized);
|
||||
};
|
||||
const handleFullscreen = (fullscreen: boolean | undefined) => {
|
||||
document.documentElement.dataset.fullscreen = String(fullscreen);
|
||||
};
|
||||
const handleActive = (active: boolean | undefined) => {
|
||||
document.documentElement.dataset.active = String(active);
|
||||
};
|
||||
|
||||
apis?.ui.isMaximized().then(handleMaximized).catch(console.error);
|
||||
apis?.ui.isFullScreen().then(handleFullscreen).catch(console.error);
|
||||
events?.ui.onMaximized(handleMaximized);
|
||||
events?.ui.onFullScreen(handleFullscreen);
|
||||
events?.ui.onTabShellViewActiveChange(handleActive);
|
||||
|
||||
mountApp();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user