not initialized device page

pull/2/merge
Szymon Lesisz 6 years ago
parent be05c097e9
commit 0cfa1567cf

@ -220,6 +220,8 @@ export const onSelectDevice = (device: TrezorDevice | Device): ThunkAction => {
dispatch( push(`/device/${ device.path }/acquire`) );
} else if (device.features.bootloader_mode) {
dispatch( push(`/device/${ device.path }/bootloader`) );
} else if (!device.features.initialized) {
dispatch( push(`/device/${ device.features.device_id }/initialize`) );
} else if (typeof device.instance === 'number') {
dispatch( push(`/device/${ device.features.device_id }:${ device.instance }`) );
} else {
@ -284,7 +286,7 @@ export const getSelectedDeviceState = (): AsyncAction => {
const selected = findSelectedDevice(getState().connect);
if (selected
&& selected.connected
&& selected.features
&& (selected.features && !selected.features.bootloader_mode && selected.features.initialized)
&& !selected.state) {
const response = await TrezorConnect.getDeviceState({

@ -56,7 +56,7 @@ const Aside = (props: Props): React$Element<typeof StickyContainer | string> =>
<AccountSelection { ...props} />
</TransitionMenu>
);
} else if (!selected.unacquired) {
} else if (selected.features && !selected.features.bootloader_mode && selected.features.initialized) {
menu = (
<TransitionMenu animationType={ "slide-right" }>
<CoinSelection { ...props} />

@ -0,0 +1,16 @@
/* @flow */
'use strict';
import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
const Initialize = () => {
return (
<section className="acquire">
<h3>Device not initialized</h3>
</section>
);
}
export default connect(null, null)(Initialize);

@ -48,7 +48,9 @@ export const findSelectedDevice = (state: State): ?TrezorDevice => {
return state.devices.find(d => {
if (d.unacquired && d.path === selected.id) {
return true;
} else if (d.features && d.features.device_id === selected.id && d.instance === selected.instance){
} else if (d.features && d.features.bootloader_mode && d.path === selected.id) {
return true;
} else if (d.features && d.features.device_id === selected.id && d.instance === selected.instance) {
return true;
}
return false;

@ -10,6 +10,7 @@ import store, { history } from '../store';
import LandingPageContainer from '../components/landing';
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 DashboardContainer from '../components/wallet/pages/Dashboard';
@ -34,6 +35,7 @@ export default (
<Route exact path="/device/:device/network/:network" component={ DashboardContainer } />
<Route exact path="/device/:device/acquire" component={ AcquireContainer } />
<Route exact path="/device/:device/bootloader" component={ BootloaderContainer } />
<Route exact path="/device/:device/initialize" component={ InitializeContainer } />
<Route exact path="/device/:device/settings" component={ DeviceSettingsContainer } />
<Route exact path="/device/:device/network/:network/account/:account" component={ SummaryContainer } />
<Route path="/device/:device/network/:network/account/:account/send" component={ SendFormContainer } />

Loading…
Cancel
Save