Browse Source

Merge pull request #870 from gre/genuine-check-false-positive-fix

Fix false positive in genuine check
master
Gaëtan Renaudeau 7 years ago
committed by GitHub
parent
commit
e106fa342c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/components/GenuineCheck.js
  2. 3
      static/i18n/en/errors.yml

4
src/components/GenuineCheck.js

@ -27,6 +27,7 @@ import IconHome from 'icons/Home'
import IconCheck from 'icons/Check'
const DeviceNotGenuineError = createCustomErrorClass('DeviceNotGenuine')
const DeviceGenuineSocketEarlyClose = createCustomErrorClass('DeviceGenuineSocketEarlyClose')
type Props = {
t: T,
@ -93,6 +94,9 @@ class GenuineCheck extends PureComponent<Props> {
logger.log(`genuine check resulted ${res} after ${(Date.now() - beforeDate) / 1000}s`, {
deviceInfo,
})
if (!res) {
throw new DeviceGenuineSocketEarlyClose()
}
const isGenuine = res === '0000'
if (!isGenuine) {
throw new DeviceNotGenuineError()

3
static/i18n/en/errors.yml

@ -5,6 +5,9 @@ BtcUnmatchedApp:
DeviceNotGenuine:
title: Possibly not genuine
description: 'Request Ledger Support assistance.'
DeviceGenuineSocketEarlyClose:
title: Sorry, try again (genuine-close)
description:
DeviceSocketFail:
title: Oops, try again
description: 'Some connection failed, so please try again.'

Loading…
Cancel
Save