mirror of
https://github.com/logto-io/logto.git
synced 2024-12-23 20:33:16 -05:00
refactor(console): promote error boundary to highest level
This commit is contained in:
parent
39bf3ccd8a
commit
2ed7b39214
2 changed files with 43 additions and 43 deletions
|
@ -8,6 +8,7 @@ import './scss/normalized.scss';
|
|||
import * as styles from './App.module.scss';
|
||||
import AppContent from './components/AppContent';
|
||||
import { getPath, sections } from './components/AppContent/components/Sidebar';
|
||||
import ErrorBoundary from './components/ErrorBoundary';
|
||||
import Toast from './components/Toast';
|
||||
import { themeStorageKey, logtoApiResource } from './consts';
|
||||
import { RequestError } from './hooks/use-api';
|
||||
|
@ -66,6 +67,7 @@ const Main = () => {
|
|||
}, [location.pathname, navigate]);
|
||||
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
<SWRConfig value={{ fetcher }}>
|
||||
<Toast />
|
||||
<Routes>
|
||||
|
@ -101,6 +103,7 @@ const Main = () => {
|
|||
</Route>
|
||||
</Routes>
|
||||
</SWRConfig>
|
||||
</ErrorBoundary>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ import { useLogto } from '@logto/react';
|
|||
import React, { useEffect } from 'react';
|
||||
import { Outlet, useHref } from 'react-router-dom';
|
||||
|
||||
import ErrorBoundary from '../ErrorBoundary';
|
||||
import LogtoLoading from '../LogtoLoading';
|
||||
import Sidebar from './components/Sidebar';
|
||||
import Topbar from './components/Topbar';
|
||||
|
@ -23,7 +22,6 @@ const AppContent = () => {
|
|||
}
|
||||
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
<div className={styles.app}>
|
||||
<Topbar />
|
||||
<div className={styles.content}>
|
||||
|
@ -33,7 +31,6 @@ const AppContent = () => {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ErrorBoundary>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue