unreadable device page (not finished)

pull/2/head
Szymon Lesisz 6 years ago
parent d3608f7701
commit 880e11d6e9

@ -112,7 +112,9 @@ export const init = (): AsyncAction => async (dispatch: Dispatch, getState: GetS
});
// $FlowIssue LOCAL not declared
window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' ? LOCAL : 'https://connect.trezor.io/5/';
// window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' ? LOCAL : 'https://connect.trezor.io/5/';
window.__TREZOR_CONNECT_SRC = 'https://sisyfos.trezor.io/connect/';
// window.__TREZOR_CONNECT_SRC = 'https://localhost:8088/';
try {
await TrezorConnect.init({
@ -205,7 +207,7 @@ export const onSelectDevice = (device: TrezorDevice | Device): ThunkAction => (d
// switch to initial url and reset this value
if (!device.features) {
dispatch(push(`/device/${device.path}/acquire`));
dispatch(push(`/device/${device.path}/${ device.type === 'unreadable' ? 'unreadable' : 'acquire' }`));
} else if (device.features.bootloader_mode) {
dispatch(push(`/device/${device.path}/bootloader`));
} else if (!device.features.initialized) {

@ -0,0 +1,37 @@
/* @flow */
import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { Notification } from '~/js/components/common/Notification';
import * as TrezorConnectActions from '~/js/actions/TrezorConnectActions';
import type { State, Dispatch } from '~/flowtype';
type Props = {
acquiring: boolean;
acquireDevice: typeof TrezorConnectActions.acquire
}
const UnreadableDevice = (props: Props) => {
return (
<section className="acquire">
<Notification
title="Unreadable device"
message="Please install bridge"
className="error"
cancelable={false}
/>
</section>
);
};
export default connect(
(state: State) => ({
acquiring: state.connect.acquiring,
}),
(dispatch: Dispatch) => ({
acquireDevice: bindActionCreators(TrezorConnectActions.acquire, dispatch),
}),
)(UnreadableDevice);

@ -12,6 +12,7 @@ import WalletContainer from '../components/wallet';
import BootloaderContainer from '../components/wallet/pages/Bootloader';
import InitializeContainer from '../components/wallet/pages/Initialize';
import AcquireContainer from '../components/wallet/pages/Acquire';
import UnreadableDeviceContainer from '../components/wallet/pages/UnreadableDevice';
import DashboardContainer from '../components/wallet/pages/Dashboard';
import SummaryContainer from '../components/wallet/account/summary';
@ -34,6 +35,7 @@ export default (
<Route exact path="/device/:device/" component={DashboardContainer} />
<Route exact path="/device/:device/network/:network" component={DashboardContainer} />
<Route exact path="/device/:device/acquire" component={AcquireContainer} />
<Route exact path="/device/:device/unreadable" component={UnreadableDeviceContainer} />
<Route exact path="/device/:device/bootloader" component={BootloaderContainer} />
<Route exact path="/device/:device/initialize" component={InitializeContainer} />
<Route exact path="/device/:device/settings" component={DeviceSettingsContainer} />

Loading…
Cancel
Save