mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 03:05:19 -04:00
added error boundary (#540)
added error boundary this prevents any faulty components to completely crash the app and instead shows this page with some help about what to do and where to report bugs.
This commit is contained in:
parent
aa0589e0b1
commit
2d3d587c78
2 changed files with 95 additions and 44 deletions
|
@ -3,62 +3,65 @@ import ReactDOM from 'react-dom'
|
|||
import { Provider } from 'react-redux'
|
||||
import { BrowserRouter as Router, Redirect, Route, Switch } from 'react-router-dom'
|
||||
import { ApplicationLoader } from './components/application-loader/application-loader'
|
||||
import { Editor } from './components/editor/editor'
|
||||
import { NotFoundErrorScreen } from './components/common/routing/not-found-error-screen'
|
||||
import { LandingLayout } from './components/landing-layout/landing-layout'
|
||||
import { Redirector } from './components/common/routing/redirector'
|
||||
import { Editor } from './components/editor/editor'
|
||||
import { ErrorBoundary } from './components/error-boundary/error-boundary'
|
||||
import { HistoryPage } from './components/history-page/history-page'
|
||||
import { IntroPage } from './components/intro-page/intro-page'
|
||||
import { LandingLayout } from './components/landing-layout/landing-layout'
|
||||
import { LoginPage } from './components/login-page/login-page'
|
||||
import { ProfilePage } from './components/profile-page/profile-page'
|
||||
import { RegisterPage } from './components/register-page/register-page'
|
||||
import { Redirector } from './components/common/routing/redirector'
|
||||
import './style/index.scss'
|
||||
import * as serviceWorker from './service-worker'
|
||||
import { store } from './redux'
|
||||
import * as serviceWorker from './service-worker'
|
||||
import './style/index.scss'
|
||||
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
<Router>
|
||||
<ApplicationLoader>
|
||||
<Switch>
|
||||
<Route path="/history">
|
||||
<LandingLayout>
|
||||
<HistoryPage/>
|
||||
</LandingLayout>
|
||||
</Route>
|
||||
<Route path="/intro">
|
||||
<LandingLayout>
|
||||
<IntroPage/>
|
||||
</LandingLayout>
|
||||
</Route>
|
||||
<Route path="/login">
|
||||
<LandingLayout>
|
||||
<LoginPage/>
|
||||
</LandingLayout>
|
||||
</Route>
|
||||
<Route path="/register">
|
||||
<LandingLayout>
|
||||
<RegisterPage/>
|
||||
</LandingLayout>
|
||||
</Route>
|
||||
<Route path="/profile">
|
||||
<LandingLayout>
|
||||
<ProfilePage/>
|
||||
</LandingLayout>
|
||||
</Route>
|
||||
<Route path="/n/:id">
|
||||
<Editor/>
|
||||
</Route>
|
||||
<Route path="/:id">
|
||||
<Redirector/>
|
||||
</Route>
|
||||
<Route path="/">
|
||||
<Redirect to="/intro"/>
|
||||
</Route>
|
||||
<Route>
|
||||
<NotFoundErrorScreen/>
|
||||
</Route>
|
||||
</Switch>
|
||||
<ErrorBoundary>
|
||||
<Switch>
|
||||
<Route path="/history">
|
||||
<LandingLayout>
|
||||
<HistoryPage/>
|
||||
</LandingLayout>
|
||||
</Route>
|
||||
<Route path="/intro">
|
||||
<LandingLayout>
|
||||
<IntroPage/>
|
||||
</LandingLayout>
|
||||
</Route>
|
||||
<Route path="/login">
|
||||
<LandingLayout>
|
||||
<LoginPage/>
|
||||
</LandingLayout>
|
||||
</Route>
|
||||
<Route path="/register">
|
||||
<LandingLayout>
|
||||
<RegisterPage/>
|
||||
</LandingLayout>
|
||||
</Route>
|
||||
<Route path="/profile">
|
||||
<LandingLayout>
|
||||
<ProfilePage/>
|
||||
</LandingLayout>
|
||||
</Route>
|
||||
<Route path="/n/:id">
|
||||
<Editor/>
|
||||
</Route>
|
||||
<Route path="/:id">
|
||||
<Redirector/>
|
||||
</Route>
|
||||
<Route path="/">
|
||||
<Redirect to="/intro"/>
|
||||
</Route>
|
||||
<Route>
|
||||
<NotFoundErrorScreen/>
|
||||
</Route>
|
||||
</Switch>
|
||||
</ErrorBoundary>
|
||||
</ApplicationLoader>
|
||||
</Router>
|
||||
</Provider>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue