on master help sign in
Further refactor Trezor accountOptions
commit5b762ca2e8bad516dadf117bcbff17a7111a1f28 authorFang <git@fang.io> dateTue 25 Jun 2019, 17:49 (7 years ago) parent41e8c68
1 file changed+5−4
src/views/Login/Trezor.js+5−4
src/views/Login/Trezor.js+5−4
@@ -13,6 +13,11 @@ import { InnerLabel, InnerLabelDropdown } from 'components/old/Base';
1313import { TREZOR_PATH } from 'lib/trezor';
1414import { useWallet } from 'store/wallet';
1515
16+const accountOptions = [
17+ { title: 'Custom path', value: 'custom' },
18+ ...times(20, i => ({ title: `Account #${i + 1}`, value: i })),
19+];
20+
1621export default function Trezor({ loginCompleted }) {
1722 const { wallet, setWallet, setWalletHdPath } = useWallet();
1823
@@ -46,10 +51,6 @@ export default function Trezor({ loginCompleted }) {
4651 });
4752 };
4853
49− let accountOptions = [{ title: 'Custom path', value: 'custom' }];
50− times(20, i => {
51− accountOptions.push({ title: `Account #${i + 1}`, value: i });
52− });
5354 let accountTitle = accountOptions.find(o => o.value === account).title;
5455
5556 const accountSelection = (