|
|
@ -1,6 +1,7 @@ |
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React, { PureComponent } from 'react' |
|
|
|
import styled from 'styled-components' |
|
|
|
import { shell, remote } from 'electron' |
|
|
|
import qs from 'querystring' |
|
|
|
import { translate } from 'react-i18next' |
|
|
@ -21,7 +22,7 @@ import { IconWrapperCircle } from './SettingsPage/sections/Profile' |
|
|
|
type Props = { |
|
|
|
error: Error, |
|
|
|
t: T, |
|
|
|
disableExport?: boolean, |
|
|
|
withoutAppData?: boolean, |
|
|
|
children?: *, |
|
|
|
} |
|
|
|
|
|
|
@ -75,7 +76,7 @@ ${error.stack} |
|
|
|
} |
|
|
|
|
|
|
|
render() { |
|
|
|
const { error, t, disableExport, children } = this.props |
|
|
|
const { error, t, withoutAppData, children } = this.props |
|
|
|
const { isHardResetting, isHardResetModalOpened } = this.state |
|
|
|
return ( |
|
|
|
<Box align="center" grow> |
|
|
@ -100,7 +101,7 @@ ${error.stack} |
|
|
|
<Button primary onClick={this.handleRestart}> |
|
|
|
{t('app:crash.restart')} |
|
|
|
</Button> |
|
|
|
{!disableExport ? <ExportLogsBtn /> : null} |
|
|
|
<ExportLogsBtn withoutAppData={withoutAppData} /> |
|
|
|
<Button primary onClick={this.handleCreateIssue}> |
|
|
|
{t('app:crash.createTicket')} |
|
|
|
</Button> |
|
|
@ -120,10 +121,8 @@ ${error.stack} |
|
|
|
renderIcon={this.hardResetIconRender} |
|
|
|
/> |
|
|
|
<Box my={6}> |
|
|
|
<ErrContainer> |
|
|
|
<strong>{String(error)}</strong> |
|
|
|
<div>{error.stack || 'no stacktrace'}</div> |
|
|
|
</ErrContainer> |
|
|
|
<ErrContainer>{`${String(error)} |
|
|
|
${error.stack || 'no stacktrace'}`}</ErrContainer>
|
|
|
|
</Box> |
|
|
|
<pre |
|
|
|
style={{ |
|
|
@ -142,21 +141,15 @@ ${error.stack} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const ErrContainer = ({ children }: { children: any }) => ( |
|
|
|
<pre |
|
|
|
style={{ |
|
|
|
margin: 'auto', |
|
|
|
maxWidth: '80vw', |
|
|
|
overflow: 'auto', |
|
|
|
fontSize: 10, |
|
|
|
fontFamily: 'monospace', |
|
|
|
cursor: 'text', |
|
|
|
userSelect: 'text', |
|
|
|
opacity: 0.3, |
|
|
|
}} |
|
|
|
> |
|
|
|
{children} |
|
|
|
</pre> |
|
|
|
) |
|
|
|
const ErrContainer = styled.pre` |
|
|
|
margin: auto; |
|
|
|
max-width: 80vw; |
|
|
|
overflow: auto; |
|
|
|
font-size: 10px; |
|
|
|
font-family: monospace; |
|
|
|
cursor: text; |
|
|
|
user-select: text; |
|
|
|
opacity: 0.3; |
|
|
|
` |
|
|
|
|
|
|
|
export default translate()(RenderError) |
|
|
|