diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/components/Support.js | 12 | ||||
| -rw-r--r-- | app/containers/SupportPage.js | 4 | ||||
| -rw-r--r-- | app/main.js | 14 |
3 files changed, 23 insertions, 7 deletions
diff --git a/app/components/Support.js b/app/components/Support.js index 2dcb6ad1ee..04e6c7392d 100644 --- a/app/components/Support.js +++ b/app/components/Support.js @@ -3,6 +3,8 @@ import React, { Component } from 'react'; import { Layout, Container, Header } from './Layout'; import ExternalLinkSVG from '../assets/images/icon-extLink.svg'; +import type { AccountReduxState } from '../redux/account/reducers'; + export type SupportReport = { email: string, message: string, @@ -16,9 +18,10 @@ export type SupportState = { sendState: 'INITIAL' | 'LOADING' | 'SUCCESS' | 'FAILED', }; export type SupportProps = { + account: AccountReduxState, onClose: () => void; onViewLog: (string) => void; - onCollectLog: () => Promise<string>; + onCollectLog: (Array<string>) => Promise<string>; onSend: (email: string, message: string, savedReport: string) => void; }; @@ -60,10 +63,15 @@ export default class Support extends Component { } _getLog() { + const toRedact = []; + if (this.props.account.accountToken) { + toRedact.push(this.props.account.accountToken.toString()); + } + const { savedReport } = this.state; return savedReport ? Promise.resolve(savedReport) : - this.props.onCollectLog() + this.props.onCollectLog(toRedact) .then( path => { return new Promise(resolve => this.setState({ savedReport: path }, () => resolve(path))); }); diff --git a/app/containers/SupportPage.js b/app/containers/SupportPage.js index e57985d7d3..4d802183d7 100644 --- a/app/containers/SupportPage.js +++ b/app/containers/SupportPage.js @@ -35,12 +35,12 @@ const mapDispatchToProps = (dispatch, _props) => { return { onClose: () => dispatch(push('/settings')), - onCollectLog: () => { + onCollectLog: (toRedact) => { return new Promise((resolve, reject) => { const id = uuid.v4(); unAnsweredIpcCalls.set(id, { resolve, reject }); - ipcRenderer.send('collect-logs', id); + ipcRenderer.send('collect-logs', id, toRedact); setTimeout(() => reapIpcCall(id), 1000); }) .catch((e) => { diff --git a/app/main.js b/app/main.js index 483a79fd5c..d9a3358e1f 100644 --- a/app/main.js +++ b/app/main.js @@ -382,7 +382,7 @@ const appDelegate = { // add IPC handler to change tray icon from renderer ipcMain.on('changeTrayIcon', (_: Event, type: TrayIconType) => trayIconManager.iconType = type); - ipcMain.on('collect-logs', (event, id) => { + ipcMain.on('collect-logs', (event, id, toRedact) => { log.info('Collecting logs in', appDelegate._logFileLocation); fs.readdir(appDelegate._logFileLocation, (err, files) => { if (err) { @@ -396,12 +396,20 @@ const appDelegate = { const reportPath = path.join(writableDirectory, uuid.v4() + '.report'); const binPath = resolveBin('problem-report'); - const args = [ + let args = [ 'collect', '--output', reportPath, - ...logFiles, ]; + if (toRedact.length > 0) { + args = args.concat([ + '--redact', ...toRedact, + '--', + ]); + } + + args = args.concat(logFiles); + execFile(binPath, args, {windowsHide: true}, (err) => { if (err) { event.sender.send('collect-logs-reply', id, err); |
