Browse Source

add FORCE_PROVIDER constant for testing

master
amougel 7 years ago
parent
commit
2139e0802c
  1. 3
      src/config/constants.js
  2. 3
      src/helpers/devices/getDeviceInfo.js

3
src/config/constants.js

@ -58,6 +58,9 @@ export const MANAGER_API_BASE = stringFromEnv(
export const BASE_SOCKET_URL = stringFromEnv('BASE_SOCKET_URL', 'wss://api.ledgerwallet.com/update')
// Provider
export const FORCE_PROVIDER = intFromEnv('FORCE_PROVIDER', 0)
// Flags
export const DEBUG_ANALYTICS = boolFromEnv('DEBUG_ANALYTICS')

3
src/helpers/devices/getDeviceInfo.js

@ -3,6 +3,7 @@
import type Transport from '@ledgerhq/hw-transport'
import { getFirmwareInfo } from 'helpers/common'
import { FORCE_PROVIDER } from 'config/constants'
export type DeviceInfo = {
targetId: string | number,
@ -31,7 +32,7 @@ export default async (transport: Transport<*>): Promise<DeviceInfo> => {
seVersion.match(/([0-9]+.[0-9])+(.[0-9]+)?((?!-osu)-([a-z]+))?(-osu)?/) || []
const isOSU = typeof parsedVersion[5] !== 'undefined'
const providerName = parsedVersion[4] || ''
const providerId = PROVIDERS[providerName]
const providerId = FORCE_PROVIDER || PROVIDERS[providerName]
const isBootloader = targetId === 0x01000001
const majMin = parsedVersion[1]
const patch = parsedVersion[2] || '.0'

Loading…
Cancel
Save