@@ -9,13 +9,13 @@ import { StatusGood } from 'grommet-icons/es6/icons/StatusGood'
99import { Header } from 'app/components/Header'
1010import { ErrorFormatter } from 'app/components/ErrorFormatter'
1111import { AlertBox } from 'app/components/AlertBox'
12- import { WalletErrors } from 'types/errors'
12+ import { WalletError } from 'types/errors'
1313import logotype from '../../../public/Icon Blue 192.png'
1414import { CountdownButton } from 'app/components/CountdownButton'
1515import { getUSBTransport } from '../../../src/app/state/importaccounts/saga'
1616import { runSaga } from 'redux-saga'
1717
18- type ConnectionStatus = 'connected' | 'disconnected' | 'connecting' | 'error'
18+ type ConnectionStatus = 'connected' | 'disconnected' | 'connecting' | WalletError
1919type ConnectionStatusIconPros = {
2020 success ?: boolean
2121 label : string
@@ -54,8 +54,8 @@ export function ExtLedgerAccessPopup() {
5454 // Used to redirect after reopening wallet
5555 window . localStorage . setItem ( 'oasis_wallet_granted_usb_ledger_timestamp' , Date . now ( ) . toString ( ) )
5656 setTimeout ( ( ) => window . close ( ) , 5_000 )
57- } catch {
58- setConnection ( 'error' )
57+ } catch ( e ) {
58+ setConnection ( e as WalletError )
5959 }
6060 }
6161
@@ -106,15 +106,15 @@ export function ExtLedgerAccessPopup() {
106106 />
107107 </ Box >
108108 ) }
109- { connection === 'error' && (
109+ { connection instanceof WalletError && (
110110 < Box margin = { { bottom : 'medium' } } >
111111 < ConnectionStatusIcon
112112 success = { false }
113113 label = { t ( 'ledger.extension.failed' , 'Connection failed' ) }
114114 withMargin
115115 />
116116 < AlertBox status = "error" >
117- < ErrorFormatter code = { WalletErrors . LedgerNoDeviceSelected } />
117+ < ErrorFormatter code = { connection . type } message = { connection . message } />
118118 </ AlertBox >
119119 </ Box >
120120 ) }
0 commit comments