|
@ -6,6 +6,7 @@ import { webFrame, remote } from 'electron' |
|
|
import React, { Component } from 'react' |
|
|
import React, { Component } from 'react' |
|
|
import { translate } from 'react-i18next' |
|
|
import { translate } from 'react-i18next' |
|
|
import { connect } from 'react-redux' |
|
|
import { connect } from 'react-redux' |
|
|
|
|
|
import KeyHandler from 'react-key-handler' |
|
|
import { createStructuredSelector, createSelector } from 'reselect' |
|
|
import { createStructuredSelector, createSelector } from 'reselect' |
|
|
import { accountsSelector, encodeAccountsModel } from 'reducers/accounts' |
|
|
import { accountsSelector, encodeAccountsModel } from 'reducers/accounts' |
|
|
import { storeSelector as settingsSelector } from 'reducers/settings' |
|
|
import { storeSelector as settingsSelector } from 'reducers/settings' |
|
@ -20,6 +21,7 @@ class ExportLogsBtn extends Component<{ |
|
|
t: *, |
|
|
t: *, |
|
|
settings: *, |
|
|
settings: *, |
|
|
accounts: *, |
|
|
accounts: *, |
|
|
|
|
|
hookToShortcut?: boolean, |
|
|
}> { |
|
|
}> { |
|
|
handleExportLogs = () => { |
|
|
handleExportLogs = () => { |
|
|
const { accounts, settings } = this.props |
|
|
const { accounts, settings } = this.props |
|
@ -49,9 +51,17 @@ class ExportLogsBtn extends Component<{ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onKeyHandle = e => { |
|
|
|
|
|
if (e.ctrlKey) { |
|
|
|
|
|
this.handleExportLogs() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
render() { |
|
|
render() { |
|
|
const { t } = this.props |
|
|
const { t, hookToShortcut } = this.props |
|
|
return ( |
|
|
return hookToShortcut ? ( |
|
|
|
|
|
<KeyHandler keyValue="e" onKeyHandle={this.onKeyHandle} /> |
|
|
|
|
|
) : ( |
|
|
<Button primary onClick={this.handleExportLogs}> |
|
|
<Button primary onClick={this.handleExportLogs}> |
|
|
{t('app:settings.exportLogs.btn')} |
|
|
{t('app:settings.exportLogs.btn')} |
|
|
</Button> |
|
|
</Button> |
|
|