-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
33 lines (29 loc) · 1019 Bytes
/
Copy pathApp.tsx
File metadata and controls
33 lines (29 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import * as React from 'react';
import { MainView } from './src/views/MainView';
import { dbService } from './services/db';
import { useZenStore } from './store/zenStore';
import { ExtremeErrorBoundary } from './components/ExtremeErrorBoundary';
import { CryptoErrorBoundary } from './components/CryptoErrorBoundary';
export default function App() {
const { setHistory } = useZenStore();
React.useEffect(() => {
// Load initial history with error handling
const loadHistory = async () => {
try {
const entries = await dbService.getAllEntries();
setHistory(entries);
} catch (error) {
console.error("DB Load failed - this is normal if vault is locked:", error);
// Don't throw error - it's normal when vault is locked
}
};
loadHistory();
}, [setHistory]);
return (
<ExtremeErrorBoundary name="App-Level" severity="critical">
<CryptoErrorBoundary>
<MainView />
</CryptoErrorBoundary>
</ExtremeErrorBoundary>
);
}