mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-05-06 14:23:30 -04:00
make App.tsx declaration order sane
This commit is contained in:
@@ -89,31 +89,6 @@ function Router() {
|
||||
);
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
useCoreEvents();
|
||||
|
||||
useEffect(() => {
|
||||
invoke<AppState>('get_config').then((state) => useAppState.getState().update(state));
|
||||
invoke<Location[]>('get_mounts').then((locations) =>
|
||||
//@ts-expect-error
|
||||
useLocationStore.getState().setLocations(locations)
|
||||
);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<ErrorBoundary
|
||||
FallbackComponent={ErrorFallback}
|
||||
// reset the state of your app so the error doesn't happen again
|
||||
onReset={() => {}}
|
||||
>
|
||||
<DebugGlobalStore />
|
||||
<BrowserRouter>
|
||||
<Router />
|
||||
</BrowserRouter>
|
||||
</ErrorBoundary>
|
||||
);
|
||||
}
|
||||
|
||||
function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
|
||||
return (
|
||||
<div
|
||||
@@ -158,3 +133,28 @@ function NotFound() {
|
||||
// useHotkeys('command+q', () => {
|
||||
// process.exit();
|
||||
// });
|
||||
|
||||
export default function App() {
|
||||
useCoreEvents();
|
||||
|
||||
useEffect(() => {
|
||||
invoke<AppState>('get_config').then((state) => useAppState.getState().update(state));
|
||||
invoke<Location[]>('get_mounts').then((locations) =>
|
||||
//@ts-expect-error
|
||||
useLocationStore.getState().setLocations(locations)
|
||||
);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<ErrorBoundary
|
||||
FallbackComponent={ErrorFallback}
|
||||
// reset the state of your app so the error doesn't happen again
|
||||
onReset={() => {}}
|
||||
>
|
||||
<DebugGlobalStore />
|
||||
<BrowserRouter>
|
||||
<Router />
|
||||
</BrowserRouter>
|
||||
</ErrorBoundary>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user