2024-09-13 10:27:07 +03:00
|
|
|
import './setup';
|
2024-03-19 10:48:56 +03:00
|
|
|
|
2024-09-13 14:31:21 +03:00
|
|
|
import { appConfigProxy } from '@affine/core/components/hooks/use-app-config-storage';
|
2024-10-30 12:16:20 +03:00
|
|
|
import { StrictMode } from 'react';
|
2024-03-19 10:48:56 +03:00
|
|
|
import { createRoot } from 'react-dom/client';
|
|
|
|
|
|
|
|
import { App } from './app';
|
|
|
|
|
|
|
|
function main() {
|
2024-04-01 10:04:39 +03:00
|
|
|
// load persistent config for electron
|
2024-06-21 10:54:14 +03:00
|
|
|
// TODO(@Peng): should be sync, but it's not necessary for now
|
2024-04-01 10:04:39 +03:00
|
|
|
appConfigProxy
|
|
|
|
.getSync()
|
|
|
|
.catch(() => console.error('failed to load app config'));
|
|
|
|
|
2024-03-19 10:48:56 +03:00
|
|
|
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);
|
|
|
|
}
|