1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-29 10:28:08 +00:00

Use isWebUSB function in utils

This commit is contained in:
Vasek Mlejnsky 2018-08-27 12:59:32 +02:00
parent a837db7a49
commit 0b1a6ce0e1
2 changed files with 4 additions and 3 deletions

View File

@ -80,6 +80,7 @@ const getStatusColor = (deviceStatus) => {
};
export {
isWebUSB,
getStatus,
isDisabled,
getStatusName,

View File

@ -11,6 +11,7 @@ import Notifications, { Notification } from 'components/Notification';
import colors from 'config/colors';
import P from 'components/Paragraph';
import { H2 } from 'components/Heading';
import { isWebUSB } from 'utils/device';
import BrowserNotSupported from './components/BrowserNotSupported';
import ConnectDevice from './components/ConnectDevice';
@ -72,7 +73,6 @@ export default (props: Props) => {
const bridgeRoute: boolean = props.router.location.state.hasOwnProperty('bridge');
const deviceLabel = props.wallet.disconnectRequest ? props.wallet.disconnectRequest.label : '';
const hasWebUsb = transport && transport.version.indexOf('webusb') >= 0;
const shouldShowInstallBridge = connectError || bridgeRoute;
const shouldShowConnectDevice = props.wallet.ready && devices.length < 1;
const shouldShowDisconnectDevice = !!props.wallet.disconnectRequest;
@ -111,7 +111,7 @@ export default (props: Props) => {
<ConnectDevice
deviceLabel={deviceLabel}
showWebUsb={hasWebUsb}
showWebUsb={isWebUSB(transport)}
showDisconnect={shouldShowDisconnectDevice}
/>
@ -119,7 +119,7 @@ export default (props: Props) => {
{shouldShowConnectDevice && (
<LandingFooterWrapper>
{hasWebUsb && (
{isWebUSB(transport) && (
<P>
<LandingFooterTextWrapper>
Device not recognized?