mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-17 23:14:03 +01:00
27 lines
830 B
TypeScript
27 lines
830 B
TypeScript
import { StrictMode } from 'react';
|
|
import { createRoot } from 'react-dom/client';
|
|
import { attachConsole } from 'tauri-plugin-log-api';
|
|
import { App } from './components/App';
|
|
import { maybeRestorePathname } from './lib/persistPathname';
|
|
import './main.css';
|
|
import { getSettings } from './lib/store';
|
|
import type { Appearance } from './lib/theme/window';
|
|
import { setAppearanceOnDocument } from './lib/theme/window';
|
|
|
|
await attachConsole();
|
|
await maybeRestorePathname();
|
|
|
|
const settings = await getSettings();
|
|
setAppearanceOnDocument(settings.appearance as Appearance);
|
|
|
|
document.addEventListener('keydown', (e) => {
|
|
// Don't go back in history on backspace
|
|
if (e.key === 'Backspace') e.preventDefault();
|
|
});
|
|
|
|
createRoot(document.getElementById('root') as HTMLElement).render(
|
|
<StrictMode>
|
|
<App />
|
|
</StrictMode>,
|
|
);
|