|
|
|
@ -112,21 +112,20 @@ export const init = (): AsyncAction => async (dispatch: Dispatch, getState: GetS
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
await TrezorConnect.init({
|
|
|
|
|
transportReconnect: true,
|
|
|
|
|
// connectSrc: 'https://localhost:8088/',
|
|
|
|
|
connectSrc: 'https://sisyfos.trezor.io/',
|
|
|
|
|
debug: false,
|
|
|
|
|
popup: false,
|
|
|
|
|
webusb: true,
|
|
|
|
|
pendingTransportEvent: (getState().devices.length < 1),
|
|
|
|
|
});
|
|
|
|
|
} catch (error) {
|
|
|
|
|
// dispatch({
|
|
|
|
|
// type: CONNECT.INITIALIZATION_ERROR,
|
|
|
|
|
// error
|
|
|
|
|
// })
|
|
|
|
|
try {
|
|
|
|
|
await TrezorConnect.init({
|
|
|
|
|
transportReconnect: true,
|
|
|
|
|
debug: false,
|
|
|
|
|
popup: false,
|
|
|
|
|
webusb: true,
|
|
|
|
|
pendingTransportEvent: (getState().devices.length < 1)
|
|
|
|
|
});
|
|
|
|
|
} catch (error) {
|
|
|
|
|
// dispatch({
|
|
|
|
|
// type: CONNECT.INITIALIZATION_ERROR,
|
|
|
|
|
// error
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -170,6 +169,22 @@ export const postInit = (): ThunkAction => (dispatch: Dispatch, getState: GetSta
|
|
|
|
|
// dispatch( push(initialPathname) );
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
if (devices.length > 0) {
|
|
|
|
|
const unacquired: ?TrezorDevice = devices.find(d => d.unacquired);
|
|
|
|
|
if (unacquired) {
|
|
|
|
|
dispatch( onSelectDevice(unacquired) );
|
|
|
|
|
} else {
|
|
|
|
|
const latest: Array<TrezorDevice> = sortDevices(devices);
|
|
|
|
|
const firstConnected: ?TrezorDevice = latest.find(d => d.connected);
|
|
|
|
|
dispatch( onSelectDevice(firstConnected || latest[0]) );
|
|
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
|
if (initialParams) {
|
|
|
|
|
if (!initialParams.hasOwnProperty("network") && initialPathname !== getState().router.location.pathname) {
|
|
|
|
|
// dispatch( push(initialPathname) );
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|