mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 01:35:18 -04:00
Adjust editor config (#976)
* Adjust editor config Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Co-authored-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
0180c75e55
commit
e12dc523f8
301 changed files with 4393 additions and 3741 deletions
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import React, { Component, ErrorInfo, ReactElement, ReactNodeArray } from 'react'
|
||||
import { Button, Container } from 'react-bootstrap'
|
||||
|
@ -16,37 +16,39 @@ export class ErrorBoundary extends Component {
|
|||
hasError: boolean
|
||||
}
|
||||
|
||||
constructor (props: Readonly<unknown>) {
|
||||
constructor(props: Readonly<unknown>) {
|
||||
super(props)
|
||||
this.state = { hasError: false }
|
||||
}
|
||||
|
||||
static getDerivedStateFromError (_error: Error): { hasError: boolean } {
|
||||
static getDerivedStateFromError(_error: Error): { hasError: boolean } {
|
||||
// Update state so the next render will show the fallback UI.
|
||||
return { hasError: true }
|
||||
}
|
||||
|
||||
componentDidCatch (error: Error, errorInfo: ErrorInfo): void {
|
||||
componentDidCatch(error: Error, errorInfo: ErrorInfo): void {
|
||||
console.error('error caught', error)
|
||||
console.error('additional information', errorInfo)
|
||||
}
|
||||
|
||||
refreshPage (): void {
|
||||
refreshPage(): void {
|
||||
window.location.reload()
|
||||
}
|
||||
|
||||
render (): ReactElement | undefined | null | string | number | boolean | Record<string, unknown> | ReactNodeArray {
|
||||
render(): ReactElement | undefined | null | string | number | boolean | Record<string, unknown> | ReactNodeArray {
|
||||
if (this.state.hasError) {
|
||||
return (
|
||||
<Container className="text-light d-flex flex-column mvh-100">
|
||||
<div className='text-light d-flex flex-column align-items-center justify-content-center my-5'>
|
||||
<h1>An unknown error occurred</h1>
|
||||
<p>Don't worry, this happens sometimes. If this is the first time you see this page then try reloading the app.</p>
|
||||
<p>Don't worry, this happens sometimes. If this is the first time you see this page then try reloading the
|
||||
app.</p>
|
||||
If you can reproduce this error, then we would be glad if you 
|
||||
<ExternalLink text={'open an issue on github'} href={frontendVersion.issueTrackerUrl} className={'text-primary'}/> 
|
||||
or <ExternalLink text={'contact us on matrix.'} href={links.chat} className={'text-primary'}/>
|
||||
<Button onClick={() => this.refreshPage()} title={'Reload App'} className={'mt-4'}>
|
||||
<ForkAwesomeIcon icon={'refresh'}/> Reload App
|
||||
<ExternalLink text={ 'open an issue on github' } href={ frontendVersion.issueTrackerUrl }
|
||||
className={ 'text-primary' }/> 
|
||||
or <ExternalLink text={ 'contact us on matrix.' } href={ links.chat } className={ 'text-primary' }/>
|
||||
<Button onClick={ () => this.refreshPage() } title={ 'Reload App' } className={ 'mt-4' }>
|
||||
<ForkAwesomeIcon icon={ 'refresh' }/> Reload App
|
||||
</Button>
|
||||
</div>
|
||||
</Container>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue