1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-25 00:18:07 +00:00

unreadable device page (not finished)

This commit is contained in:
Szymon Lesisz 2018-08-08 14:39:43 +02:00
parent d3608f7701
commit 880e11d6e9
3 changed files with 43 additions and 2 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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} />