1- import { type CSSProperties , useEffect , useState } from "react" ;
1+ import { type CSSProperties , useState } from "react" ;
22
33import { useTheme } from "@/shared/hooks/use-theme" ;
44import { Bar , Container , Section } from "@column-resizer/react" ;
@@ -16,6 +16,7 @@ import { Toaster } from "@/shared/ui/sonner";
1616import { AccountSwitcherDialog } from "@/features/settings/account-switcher-dialog" ;
1717import { SettingsDialog } from "@/features/settings/settings-dialog" ;
1818import { CommandPalette } from "@/features/command-palette" ;
19+ import { BootstrapError } from "@/features/shell/ui/bootstrap-error" ;
1920import { EditorPane } from "@/features/shell/editor-pane" ;
2021import { NoteHistoryDialog } from "@/features/shell/note-history-dialog" ;
2122import { NotesPane } from "@/features/notes/ui/notes-pane" ;
@@ -30,7 +31,6 @@ import { conflictDialogCopy } from "@/shared/lib/conflict-dialog-copy";
3031function App ( ) {
3132 useTheme ( ) ;
3233 const [ isMacos ] = useState ( ( ) => navigator . userAgent . includes ( "Mac" ) ) ;
33- const [ revealed , setRevealed ] = useState ( false ) ;
3434 const {
3535 bootstrapError,
3636 chooseConflictDialogProps,
@@ -52,31 +52,15 @@ function App() {
5252 setCommandPaletteOpen,
5353 } = useAppShortcuts ( { onCreateNote : notesPaneProps . onCreateNote } ) ;
5454
55- useEffect ( ( ) => {
56- if ( readyToRevealWindow ) setRevealed ( true ) ;
57- } , [ readyToRevealWindow ] ) ;
58-
59- useRevealMainWindow ( ! revealed ) ;
55+ const revealed = useRevealMainWindow ( readyToRevealWindow ) ;
6056
6157 const sidebarVisible = useUIStore ( ( s ) => s . sidebarVisible ) ;
6258 const notesPanelVisible = useUIStore ( ( s ) => s . notesPanelVisible ) ;
6359
6460 if ( ! revealed ) return null ;
6561
6662 if ( bootstrapError ) {
67- return (
68- < div className = "text-foreground flex min-h-screen items-center justify-center" >
69- < div className = "border-border bg-card flex max-w-lg min-w-96 flex-col gap-4 rounded-xl border px-5 py-5 shadow-sm" >
70- < div className = "space-y-1" >
71- < p className = "font-semibold" > Couldn't load your notes</ p >
72- < p className = "text-muted-foreground text-sm" > { bootstrapError } </ p >
73- </ div >
74- < div >
75- < Button onClick = { retryBootstrap } > Try again</ Button >
76- </ div >
77- </ div >
78- </ div >
79- ) ;
63+ return < BootstrapError error = { bootstrapError } onRetry = { retryBootstrap } /> ;
8064 }
8165
8266 const chooseConflictDialog = conflictDialogCopy (
0 commit comments