mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-22 09:51:35 +03:00
a791481ac8
fix AF-1394
34 lines
764 B
TypeScript
34 lines
764 B
TypeScript
import './setup';
|
|
|
|
import { appConfigProxy } from '@affine/core/components/hooks/use-app-config-storage';
|
|
import { StrictMode } from 'react';
|
|
import { createRoot } from 'react-dom/client';
|
|
|
|
import { App } from './app';
|
|
|
|
function main() {
|
|
// load persistent config for electron
|
|
// TODO(@Peng): should be sync, but it's not necessary for now
|
|
appConfigProxy
|
|
.getSync()
|
|
.catch(() => console.error('failed to load app config'));
|
|
|
|
mountApp();
|
|
}
|
|
|
|
function mountApp() {
|
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
const root = document.getElementById('app')!;
|
|
createRoot(root).render(
|
|
<StrictMode>
|
|
<App />
|
|
</StrictMode>
|
|
);
|
|
}
|
|
|
|
try {
|
|
main();
|
|
} catch (err) {
|
|
console.error('Failed to bootstrap app', err);
|
|
}
|