diff --git a/src/commands/listApps.js b/src/commands/listApps.js index 68831174..ecffac64 100644 --- a/src/commands/listApps.js +++ b/src/commands/listApps.js @@ -3,16 +3,16 @@ import { createCommand, Command } from 'helpers/ipc' import { fromPromise } from 'rxjs/observable/fromPromise' -import { withDevice } from 'helpers/deviceAccess' import listApps from 'helpers/apps/listApps' type Input = { - devicePath: string, + targetId: string | number, } + type Result = * -const cmd: Command = createCommand('devices', 'listApps', ({ devicePath }) => - fromPromise(withDevice(devicePath)(transport => listApps(transport))), +const cmd: Command = createCommand('devices', 'listApps', ({ targetId }) => + fromPromise(listApps(targetId)), ) export default cmd diff --git a/src/components/ManagerPage/AppsList.js b/src/components/ManagerPage/AppsList.js index 279ddf0f..4388182d 100644 --- a/src/components/ManagerPage/AppsList.js +++ b/src/components/ManagerPage/AppsList.js @@ -42,6 +42,7 @@ type LedgerApp = { type Props = { device: Device, + targetId: string | number, t: T, } @@ -70,10 +71,8 @@ class AppsList extends PureComponent { async fetchAppList() { try { - const { - device: { path: devicePath }, - } = this.props - const appsList = CACHED_APPS || (await listApps.send({ devicePath }).toPromise()) + const { targetId } = this.props + const appsList = CACHED_APPS || (await listApps.send({ targetId }).toPromise()) CACHED_APPS = appsList if (!this._unmounted) { this.setState({ appsList, status: 'idle' }) diff --git a/src/components/ManagerPage/index.js b/src/components/ManagerPage/index.js index 0e1c616a..cc89c859 100644 --- a/src/components/ManagerPage/index.js +++ b/src/components/ManagerPage/index.js @@ -8,7 +8,7 @@ import type { T } from 'types/common' import AppsList from './AppsList' // import DeviceInfos from './DeviceInfos' -import FirmwareUpdate from './FirmwareUpdate' +// import FirmwareUpdate from './FirmwareUpdate' import EnsureDevice from './EnsureDevice' import EnsureDashboard from './EnsureDashboard' import EnsureGenuine from './EnsureGenuine' @@ -30,15 +30,15 @@ const ManagerPage = ({ t }: Props): Node => ( {!deviceInfo.mcu && !deviceInfo.final && ( - - + /> */} + )} diff --git a/src/helpers/apps/listApps.js b/src/helpers/apps/listApps.js index 50f73837..d42ca916 100644 --- a/src/helpers/apps/listApps.js +++ b/src/helpers/apps/listApps.js @@ -1,14 +1,10 @@ // @flow import axios from 'axios' -import type Transport from '@ledgerhq/hw-transport' - -import { getFirmwareInfo } from 'helpers/common' const { API_BASE_URL } = process.env -export default async (transport: Transport<*>) => { +export default async (targetId: string | number) => { try { - const { targetId } = await getFirmwareInfo(transport) const { data: deviceData } = await axios.get( `${API_BASE_URL}/device_versions_target_id/${targetId}`, )