From f6c6b10e5ff96e1690cf45f49a5888467d184905 Mon Sep 17 00:00:00 2001 From: meriadec Date: Fri, 20 Apr 2018 12:07:27 +0200 Subject: [PATCH 1/4] Fix duplicate keys in apps list --- src/components/ManagerPage/AppsList.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 => ( Date: Fri, 20 Apr 2018 12:16:48 +0200 Subject: [PATCH 2/4] Handle device null / disconnected on manager device tab --- src/components/ManagerPage/DeviceInfos.js | 4 ++++ src/components/ManagerPage/index.js | 20 +++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/components/ManagerPage/DeviceInfos.js b/src/components/ManagerPage/DeviceInfos.js index d16146e7..8b8ec5d8 100644 --- a/src/components/ManagerPage/DeviceInfos.js +++ b/src/components/ManagerPage/DeviceInfos.js @@ -49,6 +49,10 @@ class DeviceInfos extends PureComponent { 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' && } ) } From 2f80a060ae1f235e09f72fb2fa1c7e1da71d1a08 Mon Sep 17 00:00:00 2001 From: meriadec Date: Fri, 20 Apr 2018 12:18:39 +0200 Subject: [PATCH 3/4] Handle auto-focus on all password modal cases --- src/components/SettingsPage/PasswordModal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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')} { )} Date: Fri, 20 Apr 2018 13:27:43 +0200 Subject: [PATCH 4/4] Close modal after importing accounts --- src/components/modals/AddAccount/index.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/components/modals/AddAccount/index.js b/src/components/modals/AddAccount/index.js index 5287335f..0e70faed 100644 --- a/src/components/modals/AddAccount/index.js +++ b/src/components/modals/AddAccount/index.js @@ -228,21 +228,12 @@ class AddAccountModal extends PureComponent { 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 = () => {