trezor-connect iframe loading error

pull/102/head
Szymon Lesisz 6 years ago
parent 2e4acf3ee8
commit f59b9c31b1

@ -0,0 +1,23 @@
/* @flow */
import React from 'react';
import styled from 'styled-components';
import { Notification } from 'components/Notification';
const Wrapper = styled.div`
min-width: 720px;
width: 100%;
`;
const InitializationError = (props: { error: ?string }) => (
<Wrapper>
<Notification
title="Initialization error"
message={props.error || ''}
type="error"
cancelable={false}
/>
</Wrapper>
);
export default InitializationError;

@ -14,6 +14,7 @@ import { H2 } from 'components/Heading';
import { isWebUSB } from 'utils/device';
import { FONT_SIZE } from 'config/variables';
import InitializationError from './components/InitializationError';
import BrowserNotSupported from './components/BrowserNotSupported';
import ConnectDevice from './components/ConnectDevice';
import InstallBridge from './components/InstallBridge';
@ -77,13 +78,13 @@ export default (props: Props) => {
const bridgeRoute: boolean = props.router.location.state.hasOwnProperty('bridge');
const deviceLabel = props.wallet.disconnectRequest ? props.wallet.disconnectRequest.label : '';
const shouldShowInstallBridge = connectError || bridgeRoute;
const shouldShowInitializationError = connectError && !props.connect.initialized;
const shouldShowInstallBridge = props.connect.initialized && (connectError || bridgeRoute);
const shouldShowConnectDevice = props.wallet.ready && devices.length < 1;
const shouldShowDisconnectDevice = !!props.wallet.disconnectRequest;
const shouldShowUnsupportedBrowser = browserState.supported === false;
const isLoading = !shouldShowInstallBridge && !shouldShowConnectDevice && !shouldShowUnsupportedBrowser && !localStorageError;
const isLoading = !shouldShowInitializationError && !shouldShowInstallBridge && !shouldShowConnectDevice && !shouldShowUnsupportedBrowser && !localStorageError;
return (
<LandingWrapper>
{isLoading && <LandingLoader text="Loading" size={100} />}
@ -98,10 +99,9 @@ export default (props: Props) => {
/>
)}
<Notifications />
{shouldShowInitializationError && <InitializationError error={connectError} />}
<Log />
<LandingContent>
{shouldShowUnsupportedBrowser && <BrowserNotSupported />}
{shouldShowInstallBridge && <InstallBridge browserState={browserState} />}

@ -1,14 +1,8 @@
/* @flow */
import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import styled from 'styled-components';
import { Notification } from 'components/Notification';
import * as TrezorConnectActions from 'actions/TrezorConnectActions';
import type { State, Dispatch } from 'flowtype';
const Wrapper = styled.div``;
@ -23,4 +17,4 @@ const UnreadableDevice = () => (
</Wrapper>
);
export default connect(null, null)(UnreadableDevice);
export default UnreadableDevice;

Loading…
Cancel
Save