diff --git a/src/components/ManagerPage/AppsList.js b/src/components/ManagerPage/AppsList.js index eb25dca4..02e3c67e 100644 --- a/src/components/ManagerPage/AppsList.js +++ b/src/components/ManagerPage/AppsList.js @@ -39,6 +39,10 @@ type LedgerApp = { version: string, icon: string, app: Object, + bolos_version: { + min: number, + max: number, + }, } type Props = { @@ -120,7 +124,7 @@ class AppsList extends PureComponent { {this.state.appsList.map(c => ( { const { device } = this.props const { memoryInfos, isLoading } = this.state + if (!device) { + return {'You dont have any device connected'} + } + const title = ( {device.manufacturer} diff --git a/src/components/ManagerPage/index.js b/src/components/ManagerPage/index.js index 5aa407d6..836c9795 100644 --- a/src/components/ManagerPage/index.js +++ b/src/components/ManagerPage/index.js @@ -9,7 +9,6 @@ import type { Device, T } from 'types/common' import { getCurrentDevice, getDevices } from 'reducers/devices' -import Box from 'components/base/Box' import Pills from 'components/base/Pills' import AppsList from './AppsList' @@ -37,6 +36,14 @@ class ManagerPage extends PureComponent { currentTab: 'apps', } + componentWillReceiveProps(nextProps) { + const { device } = this.props + const { currentTab } = this.state + if (device && !nextProps.device && currentTab === 'device') { + this.setState({ currentTab: 'apps' }) + } + } + handleTabChange = t => this.setState({ currentTab: t.value }) render() { @@ -45,19 +52,18 @@ class ManagerPage extends PureComponent { const tabs = TABS.map(i => { let label = t(`manager:tabs.${i.key}`) if (i.key === 'device') { + if (!device) { + return null + } label += ` (${nbDevices})` } return { ...i, label } - }) + }).filter(Boolean) return ( {currentTab === 'apps' && } - {currentTab === 'device' && ( - - - - )} + {currentTab === 'device' && } ) } diff --git a/src/components/SettingsPage/PasswordModal.js b/src/components/SettingsPage/PasswordModal.js index a5921584..85119688 100644 --- a/src/components/SettingsPage/PasswordModal.js +++ b/src/components/SettingsPage/PasswordModal.js @@ -94,9 +94,9 @@ class PasswordModal extends PureComponent { {t('settings:profile.passwordModalPasswordInput')} { )} { handleChangeStatus = (deviceStatus, appStatus) => this.setState({ appStatus }) handleImportAccount = () => { - const { archivedAccounts, updateAccount } = this.props + const { archivedAccounts, updateAccount, closeModal } = this.props const { selectedAccounts } = this.state - const accounts = archivedAccounts.filter(a => selectedAccounts.includes(a.id)) - - accounts.forEach(a => - updateAccount({ - ...a, - archived: false, - }), - ) - - this.setState({ - selectedAccounts: [], - }) + accounts.forEach(a => updateAccount({ ...a, archived: false })) + this.setState({ selectedAccounts: [] }) + closeModal(MODAL_ADD_ACCOUNT) } handleNextStep = () => {