@ -1,14 +1,8 @@
/* @flow */
import * as React from 'react' ;
import { Notification } from 'components/Notification' ;
import type {
State , TrezorDevice , Action , ThunkAction ,
} from 'flowtype' ;
import type { Account } from 'reducers/AccountsReducer' ;
import type { Discovery } from 'reducers/DiscoveryReducer' ;
import type { State } from 'flowtype' ;
export type StateProps = {
className : string ;
@ -63,7 +57,7 @@ const SelectedAccount = (props: Props) => {
return (
< section >
< Notification
classNam e= "info"
typ e= "info"
title = { ` Device ${ device . instanceLabel } is disconnected ` }
message = "Connect device to load accounts"
/ >
@ -73,34 +67,34 @@ const SelectedAccount = (props: Props) => {
// case 4: backend is not working
return (
< section >
< Notification classNam e= "warning" title = "Backend not working" / >
< Notification typ e= "warning" title = "Backend not working" / >
< / s e c t i o n >
) ;
} if ( discovery . completed ) {
// case 5: account not found and discovery is completed
return (
< section >
< Notification classNam e= "warning" title = "Account does not exist" / >
< Notification typ e= "warning" title = "Account does not exist" / >
< / s e c t i o n >
) ;
}
// case 6: discovery is not completed yet
return (
< section >
< Notification classNam e= "info" title = "Loading accounts..." / >
< Notification typ e= "info" title = "Loading accounts..." / >
< / s e c t i o n >
) ;
}
let notification : ? React$Element < typeof Notification > = null ;
if ( ! device . connected ) {
notification = < Notification classNam e= "info" title = { ` Device ${ device . instanceLabel } is disconnected ` } / > ;
notification = < Notification typ e= "info" title = { ` Device ${ device . instanceLabel } is disconnected ` } / > ;
} else if ( ! device . available ) {
notification = < Notification classNam e= "info" title = { ` Device ${ device . instanceLabel } is unavailable ` } message = "Change passphrase settings to use this device" / > ;
notification = < Notification typ e= "info" title = { ` Device ${ device . instanceLabel } is unavailable ` } message = "Change passphrase settings to use this device" / > ;
}
if ( discovery && ! discovery . completed && ! notification ) {
notification = < Notification classNam e= "info" title = "Loading accounts..." / > ;
notification = < Notification typ e= "info" title = "Loading accounts..." / > ;
}
return (