on master help sign in
Further refactor Trezor accountOptions
5b762caFang
src/views/Login/Trezor.js+5−4
@@ -13,6 +13,11 @@ import { InnerLabel, InnerLabelDropdown } from 'components/old/Base';
13import { TREZOR_PATH } from 'lib/trezor';
13import { TREZOR_PATH } from 'lib/trezor';
14import { useWallet } from 'store/wallet';
14import { useWallet } from 'store/wallet';
15
15
16+const accountOptions = [
17+ { title: 'Custom path', value: 'custom' },
18+ ...times(20, i => ({ title: `Account #${i + 1}`, value: i })),
19+];
20+
16export default function Trezor({ loginCompleted }) {
21export default function Trezor({ loginCompleted }) {
17 const { wallet, setWallet, setWalletHdPath } = useWallet();
22 const { wallet, setWallet, setWalletHdPath } = useWallet();
18
23
@@ -46,10 +51,6 @@ export default function Trezor({ loginCompleted }) {
46 });
51 });
47 };
52 };
48
53
49− let accountOptions = [{ title: 'Custom path', value: 'custom' }];
50− times(20, i => {
51− accountOptions.push({ title: `Account #${i + 1}`, value: i });
52− });
53 let accountTitle = accountOptions.find(o => o.value === account).title;
54 let accountTitle = accountOptions.find(o => o.value === account).title;
54
55
55 const accountSelection = (
56 const accountSelection = (