diff --git a/src/commands/listApps.js b/src/commands/listApps.js index b600aef4..d9b542b5 100644 --- a/src/commands/listApps.js +++ b/src/commands/listApps.js @@ -5,14 +5,15 @@ import { fromPromise } from 'rxjs/observable/fromPromise' import listApps from 'helpers/apps/listApps' -type Input = { - targetId: string | number, -} +// type Input = { +// targetId: string | number, +// } +type Input = * type Result = * -const cmd: Command = createCommand('listApps', ({ targetId }) => - fromPromise(listApps(targetId)), +const cmd: Command = createCommand('listApps', () => + /* { targetId } */ fromPromise(listApps()), ) export default cmd diff --git a/src/components/ManagerPage/AppsList.js b/src/components/ManagerPage/AppsList.js index 9971e69e..74c3f85c 100644 --- a/src/components/ManagerPage/AppsList.js +++ b/src/components/ManagerPage/AppsList.js @@ -43,7 +43,7 @@ type LedgerApp = { type Props = { device: Device, - targetId: string | number, + // targetId: string | number, t: T, } @@ -72,8 +72,8 @@ class AppsList extends PureComponent { async fetchAppList() { try { - const { targetId } = this.props - const appsList = CACHED_APPS || (await listApps.send({ targetId }).toPromise()) + // const { targetId } = this.props + const appsList = CACHED_APPS || (await listApps.send().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 d4bc2d4f..f09557d0 100644 --- a/src/components/ManagerPage/index.js +++ b/src/components/ManagerPage/index.js @@ -1,58 +1,62 @@ // @flow -import React, { Fragment } from 'react' -import { translate } from 'react-i18next' +// import React, { Fragment } from 'react' +import React from 'react' +// import { translate } from 'react-i18next' import type { Node } from 'react' -import type { T, Device } from 'types/common' +// import type { T, Device } from 'types/common' +import type { Device } 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' - -type DeviceInfo = { - targetId: number | string, - version: string, - final: boolean, - mcu: boolean, -} - -type Props = { - t: T, -} - -const ManagerPage = ({ t }: Props): Node => ( - - - {(device: Device) => ( - - {(deviceInfo: DeviceInfo) => ( - - {deviceInfo.mcu && bootloader mode } - {deviceInfo.final && osu mode } - {!deviceInfo.mcu && - !deviceInfo.final && ( - - - - - )} - - )} - - )} - - +// import EnsureDashboard from './EnsureDashboard' +// import EnsureGenuine from './EnsureGenuine' + +// type DeviceInfo = { +// targetId: number | string, +// version: string, +// final: boolean, +// mcu: boolean, +// } + +// type Props = { +// t: T, +// } + +// const ManagerPage = ({ t }: Props): Node => ( +// +// {(device: Device) => ( +// +// {(deviceInfo: DeviceInfo) => ( +// +// {deviceInfo.mcu && bootloader mode } +// {deviceInfo.final && osu mode } +// {!deviceInfo.mcu && +// !deviceInfo.final && ( +// +// +// +// +// )} +// +// )} +// +// )} +// +// ) + +const ManagerPage = (): Node => ( + {(device: Device) => } ) -export default translate()(ManagerPage) +export default ManagerPage diff --git a/src/helpers/apps/listApps.js b/src/helpers/apps/listApps.js index d42ca916..7a5cf43e 100644 --- a/src/helpers/apps/listApps.js +++ b/src/helpers/apps/listApps.js @@ -1,18 +1,18 @@ // @flow import axios from 'axios' -const { API_BASE_URL } = process.env +// const { API_BASE_URL } = process.env -export default async (targetId: string | number) => { +export default async (/* targetId: string | number */) => { try { - const { data: deviceData } = await axios.get( - `${API_BASE_URL}/device_versions_target_id/${targetId}`, - ) + // const { data: deviceData } = await axios.get( + // `${API_BASE_URL}/device_versions_target_id/${targetId}`, + // ) const { data } = await axios.get('https://api.ledgerwallet.com/update/applications') - if (deviceData.name in data) { - return data[deviceData.name] - } + // if (deviceData.name in data) { + // return data[deviceData.name] + // } return data['nanos-1.4'] } catch (err) {