Enable ledger in settings (on capable chains) (#1681)

This commit is contained in:
Jaco Greeff 2019-09-30 17:45:42 +02:00 committed by GitHub
parent 71de448eb4
commit 367e135d31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,6 @@
import { I18nProps } from '@polkadot/react-components/types';
import { Option } from './types';
import queryString from 'query-string';
import React, { useEffect, useState } from 'react';
import { isLedgerCapable } from '@polkadot/react-api';
import { Button, Dropdown } from '@polkadot/react-components';
@ -20,10 +19,6 @@ interface Props extends I18nProps{
onClose?: () => void;
}
// check for a ledger=... string, acivate
const urlOptions = queryString.parse(location.href.split('?')[1]);
const WITH_LEDGER = !!urlOptions.ledger;
const prefixOptions = uiSettings.availablePrefixes.map((o): Option => createOption(o, ['default']));
const iconOptions = uiSettings.availableIcons.map((o): Option => createIdenticon(o, ['default']));
const ledgerConnOptions = uiSettings.availableLedgerConn;
@ -90,7 +85,7 @@ function General ({ className, isModalContent, onClose, t }: Props): React.React
options={uiSettings.availableUIModes}
/>
</div>
{WITH_LEDGER && isLedgerCapable() && (
{isLedgerCapable() && (
<div className='ui--row'>
<Dropdown
defaultValue={ledgerConn}