Browse Source

Merge branch 'develop' into better-logs

master
Gaëtan Renaudeau 7 years ago
committed by GitHub
parent
commit
dffccdf29e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      src/components/modals/Send/index.js
  2. 5
      src/components/modals/Send/steps/01-step-amount.js
  3. 14
      src/internals/index.js
  4. 8
      src/main/bridge.js

12
src/components/modals/Send/index.js

@ -44,6 +44,7 @@ type Props = {
type State<Transaction> = {
stepId: string,
openedFromAccount: boolean,
account: ?Account,
bridge: ?WalletBridge<Transaction>,
transaction: ?Transaction,
@ -54,6 +55,7 @@ type State<Transaction> = {
}
export type StepProps<Transaction> = DefaultStepProps & {
openedFromAccount: boolean,
device: ?Device,
account: ?Account,
bridge: ?WalletBridge<Transaction>,
@ -118,6 +120,7 @@ const mapDispatchToProps = {
const INITIAL_STATE = {
stepId: 'amount',
amount: 0,
openedFromAccount: false,
account: null,
bridge: null,
transaction: null,
@ -151,7 +154,12 @@ class SendModal extends PureComponent<Props, State<*>> {
const account = (data && data.account) || accounts[0]
const bridge = account ? getBridgeForCurrency(account.currency) : null
const transaction = bridge ? bridge.createTransaction(account) : null
this.setState({ account, bridge, transaction })
this.setState({
openedFromAccount: !!(data && data.account),
account,
bridge,
transaction,
})
}
}
@ -227,6 +235,7 @@ class SendModal extends PureComponent<Props, State<*>> {
const { t, device, openModal } = this.props
const {
stepId,
openedFromAccount,
account,
isAppOpened,
bridge,
@ -237,6 +246,7 @@ class SendModal extends PureComponent<Props, State<*>> {
const addtionnalProps = {
device,
openedFromAccount,
account,
bridge,
transaction,

5
src/components/modals/Send/steps/01-step-amount.js

@ -20,6 +20,7 @@ export default ({
t,
account,
bridge,
openedFromAccount,
transaction,
onChangeAccount,
onChangeTransaction,
@ -35,14 +36,14 @@ export default ({
<Box flow={4}>
<Box flow={1}>
<Label>{t('app:send.steps.amount.selectAccountDebit')}</Label>
<SelectAccount onChange={onChangeAccount} value={account} />
<SelectAccount autoFocus={!openedFromAccount} onChange={onChangeAccount} value={account} />
</Box>
{account &&
bridge &&
transaction && (
<RecipientField
autoFocus
autoFocus={openedFromAccount}
account={account}
bridge={bridge}
transaction={transaction}

14
src/internals/index.js

@ -11,7 +11,15 @@ logger.setProcessShortName('internal')
require('../env')
process.title = 'Internal'
process.title = 'Ledger Live Internal'
process.on('uncaughtException', err => {
process.send({
type: 'uncaughtException',
error: serializeError(err),
})
process.exit(1)
})
const defers = {}
@ -107,4 +115,8 @@ process.on('message', m => {
}
})
process.on('disconnect', () => {
process.exit(0)
})
logger.log('Internal process is up!')

8
src/main/bridge.js

@ -7,9 +7,10 @@ import { ipcMain, app } from 'electron'
import { ipcMainListenReceiveCommands } from 'helpers/ipc'
import path from 'path'
import logger from 'logger'
import sentry from 'sentry/node'
import sentry, { captureException } from 'sentry/node'
import user from 'helpers/user'
import resolveLogsDirectory from 'helpers/resolveLogsDirectory'
import { deserializeError } from 'helpers/errors'
import setupAutoUpdater, { quitAndInstall } from './autoUpdate'
import { setInternalProcessPID } from './terminator'
@ -105,6 +106,11 @@ ipcMainListenReceiveCommands({
function handleGlobalInternalMessage(payload) {
switch (payload.type) {
case 'uncaughtException': {
const err = deserializeError(payload.error)
captureException(err)
break
}
case 'setLibcoreBusy':
case 'setDeviceBusy':
case 'executeHttpQueryOnRenderer': {

Loading…
Cancel
Save