mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-17 06:16:59 +08:00
@@ -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