diff --git a/src/components/AppError.js b/src/components/AppError.js index 7ae0ca90..b8f59f71 100644 --- a/src/components/AppError.js +++ b/src/components/AppError.js @@ -13,7 +13,7 @@ import RenderError from './RenderError' const App = ({ language, error }: { error: Error, language: string }) => ( - + diff --git a/src/components/ExportLogsBtn.js b/src/components/ExportLogsBtn.js index a64c6df7..07c1ca66 100644 --- a/src/components/ExportLogsBtn.js +++ b/src/components/ExportLogsBtn.js @@ -19,15 +19,24 @@ const mapStateToProps = createStructuredSelector({ class ExportLogsBtn extends Component<{ t: *, - settings: *, - accounts: *, + settings: ?*, + accounts: ?*, hookToShortcut?: boolean, }> { handleExportLogs = () => { const { accounts, settings } = this.props const logs = logger.exportLogs() const resourceUsage = webFrame.getResourceUsage() - const report = { resourceUsage, logs, accounts, settings, date: new Date() } + const report = { + resourceUsage, + logs, + accounts, + settings, + date: new Date(), + release: __APP_VERSION__, + git_commit: __GIT_REVISION__, + environment: __DEV__ ? 'development' : 'production', + } console.log(report) // eslint-disable-line no-console const reportJSON = JSON.stringify(report) const path = remote.dialog.showSaveDialog({ @@ -69,4 +78,10 @@ class ExportLogsBtn extends Component<{ } } -export default translate()(connect(mapStateToProps)(ExportLogsBtn)) +const WithAppData = connect(mapStateToProps)(ExportLogsBtn) +const WithoutAppData = ExportLogsBtn + +const ExportLogsBtnDispatcher = ({ withAppData, ...rest }: *) => + withAppData ? : + +export default translate()(ExportLogsBtnDispatcher) diff --git a/src/components/RenderError.js b/src/components/RenderError.js index ed888ae4..8cd8c0f8 100644 --- a/src/components/RenderError.js +++ b/src/components/RenderError.js @@ -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 ( @@ -100,7 +101,7 @@ ${error.stack} - {!disableExport ? : null} + @@ -120,10 +121,8 @@ ${error.stack} renderIcon={this.hardResetIconRender} /> - - {String(error)} -
{error.stack || 'no stacktrace'}
-
+ {`${String(error)} +${error.stack || 'no stacktrace'}`}
 (
-  
-    {children}
-  
-) +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)