From a5ac8ce94492b63b1870f7198d4aebc1e255fad1 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Tue, 26 Feb 2019 12:36:19 +0100 Subject: [PATCH 1/8] bump trezor-connect@7.0.0-beta.3 --- package.json | 2 +- yarn.lock | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 74ec7d3d..84d8eaab 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "styled-components": "^4.1.3", "styled-normalize": "^8.0.6", "trezor-bridge-communicator": "1.0.2", - "trezor-connect": "7.0.0-beta.2", + "trezor-connect": "7.0.0-beta.3", "wallet-address-validator": "^0.2.4", "web3": "1.0.0-beta.38", "webpack": "^4.29.3", diff --git a/yarn.lock b/yarn.lock index ef448946..32b11a19 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4250,10 +4250,15 @@ eventemitter3@3.1.0, eventemitter3@^3.0.0, eventemitter3@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" -events@^1.0.0, events@^1.1.1: +events@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" +events@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88" + integrity sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA== + eventsource@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.0.7.tgz#8fbc72c93fcd34088090bc0a4e64f4b5cee6d8d0" @@ -10564,13 +10569,14 @@ trezor-bridge-communicator@1.0.2: request "^2.88.0" whatwg-fetch "^3.0.0" -trezor-connect@7.0.0-beta.2: - version "7.0.0-beta.2" - resolved "https://registry.yarnpkg.com/trezor-connect/-/trezor-connect-7.0.0-beta.2.tgz#10dc04e1b60804263e9873cd503a4fc9d3e940d2" +trezor-connect@7.0.0-beta.3: + version "7.0.0-beta.3" + resolved "https://registry.yarnpkg.com/trezor-connect/-/trezor-connect-7.0.0-beta.3.tgz#34aff422e36745eac24a266bcdfa266282ac5255" + integrity sha512-aRh+Vzfqy/2GMJnsvtrzGhwi9j9wjOkBrNN62HTD2sDXLrcROlQMHBCd5lPjSZaJk1npjw5rrvhPS3G9IeyiVw== dependencies: - babel-runtime "^6.26.0" - events "^1.1.1" - whatwg-fetch "^2.0.4" + "@babel/runtime" "^7.3.1" + events "^3.0.0" + whatwg-fetch "^3.0.0" trim-newlines@^2.0.0: version "2.0.0" @@ -11427,7 +11433,7 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: dependencies: iconv-lite "0.4.19" -whatwg-fetch@2.0.4, whatwg-fetch@^2.0.4: +whatwg-fetch@2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" From 149b07cb2ed54bf6596e508d610152e119d4a162 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Tue, 26 Feb 2019 12:37:26 +0100 Subject: [PATCH 2/8] connect7 changes --- src/actions/DiscoveryActions.js | 2 +- src/actions/ReceiveActions.js | 3 +++ src/actions/TrezorConnectActions.js | 6 +++++- src/flowtype/index.js | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/actions/DiscoveryActions.js b/src/actions/DiscoveryActions.js index be0ddb03..5feebc38 100644 --- a/src/actions/DiscoveryActions.js +++ b/src/actions/DiscoveryActions.js @@ -205,7 +205,7 @@ const discoverAccount = (device: TrezorDevice, discoveryProcess: Discovery): Asy } // handle outdated firmware error - if (error.message === UI.FIRMWARE) { + if (error.message === UI.FIRMWARE_OLD) { dispatch({ type: DISCOVERY.FIRMWARE_OUTDATED, device, diff --git a/src/actions/ReceiveActions.js b/src/actions/ReceiveActions.js index 116a5c15..70523e30 100644 --- a/src/actions/ReceiveActions.js +++ b/src/actions/ReceiveActions.js @@ -94,6 +94,9 @@ export const showAddress = (path: Array): AsyncAction => async (dispatch type: RECEIVE.HIDE_ADDRESS, }); + // special case: device no-backup permissions not granted + if (response.payload.code === 403) return; + dispatch({ type: NOTIFICATION.ADD, payload: { diff --git a/src/actions/TrezorConnectActions.js b/src/actions/TrezorConnectActions.js index dfbde361..f25f5477 100644 --- a/src/actions/TrezorConnectActions.js +++ b/src/actions/TrezorConnectActions.js @@ -120,7 +120,7 @@ export const init = (): AsyncAction => async (dispatch: Dispatch, getState: GetS if (buildUtils.isDev()) { window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' ? LOCAL : 'https://sisyfos.trezor.io/connect/'; // eslint-disable-line no-underscore-dangle - // window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' ? LOCAL : 'https://connect.trezor.io/5/'; // eslint-disable-line no-underscore-dangle + // window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' ? LOCAL : 'https://localhost:8088/'; // eslint-disable-line no-underscore-dangle window.TrezorConnect = TrezorConnect; } @@ -131,6 +131,10 @@ export const init = (): AsyncAction => async (dispatch: Dispatch, getState: GetS popup: false, webusb: true, pendingTransportEvent: (getState().devices.length < 1), + manifest: { + email: 'info@trezor.io', + appUrl: 'http://beta-wallet.trezor.io/next/', + }, }); } catch (error) { dispatch({ diff --git a/src/flowtype/index.js b/src/flowtype/index.js index e5e24d07..88cd5e0e 100644 --- a/src/flowtype/index.js +++ b/src/flowtype/index.js @@ -38,6 +38,7 @@ import type { Device, Features, DeviceStatus, + FirmwareRelease, DeviceFirmwareStatus, DeviceMode, DeviceMessageType, @@ -55,6 +56,7 @@ export type AcquiredDevice = $Exact<{ +label: string, +features: Features, +firmware: DeviceFirmwareStatus, + +firmwareRelease: ?FirmwareRelease, status: DeviceStatus, +mode: DeviceMode, state: ?string, From 2607417583fb503e1676a0e09acddae9d5b23dfb Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Tue, 26 Feb 2019 12:37:40 +0100 Subject: [PATCH 3/8] FirmwareUpdate target --- src/views/Wallet/views/FirmwareUpdate/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/Wallet/views/FirmwareUpdate/index.js b/src/views/Wallet/views/FirmwareUpdate/index.js index f15bcfa4..31e1da69 100644 --- a/src/views/Wallet/views/FirmwareUpdate/index.js +++ b/src/views/Wallet/views/FirmwareUpdate/index.js @@ -49,6 +49,14 @@ const StyledP = styled(P)` text-align: center; `; +const getFirmwareReleaseLink = (device: ?TrezorDevice): string => { + if (!device || !device.firmwareRelease) return 'https://beta-wallet.trezor.io'; + const release = device.firmwareRelease; + const url = release.channel === 'beta' ? 'https://beta-wallet.trezor.io/' : 'https://wallet.trezor.io/'; + const version = release.version.join('.'); + return `${url}?fw=${version}`; +}; + const FirmwareUpdate = (props: Props) => ( @@ -129,7 +137,7 @@ const FirmwareUpdate = (props: Props) => (

It’s time to update your firmware

Please use Bitcoin wallet interface to update your firmware. - + {deviceUtils.isDeviceAccessible(props.device) && ( From b45a3d3eee2e57af0fc837d068305337831fe4fc Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Tue, 26 Feb 2019 13:20:09 +0100 Subject: [PATCH 4/8] Update TrezorConnectActions.js --- src/actions/TrezorConnectActions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actions/TrezorConnectActions.js b/src/actions/TrezorConnectActions.js index f25f5477..78eb12a4 100644 --- a/src/actions/TrezorConnectActions.js +++ b/src/actions/TrezorConnectActions.js @@ -133,7 +133,7 @@ export const init = (): AsyncAction => async (dispatch: Dispatch, getState: GetS pendingTransportEvent: (getState().devices.length < 1), manifest: { email: 'info@trezor.io', - appUrl: 'http://beta-wallet.trezor.io/next/', + appUrl: 'https://beta-wallet.trezor.io/next/', }, }); } catch (error) { From 42fdb7728a6756f3c1eea5ce58556f7e9e2d761a Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 26 Feb 2019 13:40:22 +0100 Subject: [PATCH 5/8] Added url constants for wallets --- src/actions/TrezorConnectActions.js | 3 +- .../modals/confirm/NoBackup/index.js | 83 +++++++++++++++++++ src/constants/urls.js | 5 ++ .../Wallet/views/DeviceSettings/index.js | 3 +- .../Wallet/views/FirmwareUpdate/index.js | 5 +- src/views/Wallet/views/Initialize/index.js | 3 +- 6 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 src/components/modals/confirm/NoBackup/index.js create mode 100644 src/constants/urls.js diff --git a/src/actions/TrezorConnectActions.js b/src/actions/TrezorConnectActions.js index 78eb12a4..8b05b218 100644 --- a/src/actions/TrezorConnectActions.js +++ b/src/actions/TrezorConnectActions.js @@ -3,6 +3,7 @@ import TrezorConnect, { DEVICE, DEVICE_EVENT, UI_EVENT, TRANSPORT_EVENT, BLOCKCHAIN_EVENT, } from 'trezor-connect'; import { CONTEXT_NONE } from 'actions/constants/modal'; +import urlConstants from 'constants/urls'; import * as CONNECT from 'actions/constants/TrezorConnect'; import * as NOTIFICATION from 'actions/constants/notification'; import { getDuplicateInstanceNumber } from 'reducers/utils'; @@ -133,7 +134,7 @@ export const init = (): AsyncAction => async (dispatch: Dispatch, getState: GetS pendingTransportEvent: (getState().devices.length < 1), manifest: { email: 'info@trezor.io', - appUrl: 'https://beta-wallet.trezor.io/next/', + appUrl: urlConstants.NEXT_WALLET, }, }); } catch (error) { diff --git a/src/components/modals/confirm/NoBackup/index.js b/src/components/modals/confirm/NoBackup/index.js new file mode 100644 index 00000000..61d04230 --- /dev/null +++ b/src/components/modals/confirm/NoBackup/index.js @@ -0,0 +1,83 @@ +/* @flow */ + +import React from 'react'; +import PropTypes from 'prop-types'; +import styled from 'styled-components'; + +import icons from 'config/icons'; +import urlConstants from 'constants/urls'; +import colors from 'config/colors'; + +import { H2 } from 'components/Heading'; +import P from 'components/Paragraph'; +import Icon from 'components/Icon'; +import Button from 'components/Button'; +import Link from 'components/Link'; + +import type { Props as BaseProps } from '../../Container'; + +type Props = { + onReceiveConfirmation: $ElementType<$ElementType, 'onReceiveConfirmation'>; +} + +const Wrapper = styled.div` + max-width: 370px; + padding: 30px 48px; +`; + +const StyledLink = styled(Link)` + position: absolute; + right: 15px; + top: 15px; +`; + +const BackupButton = styled(Button)` + width: 100%; + margin-bottom: 10px; +`; + +const ProceedButton = styled(Button)` + background: transparent; + border-color: ${colors.WARNING_PRIMARY}; + color: ${colors.WARNING_PRIMARY}; + + &:focus, + &:hover, + &:active { + color: ${colors.WHITE}; + background: ${colors.WARNING_PRIMARY}; + box-shadow: none; + } +`; + +const StyledP = styled(P)` + padding-bottom: 20px; +`; + +const Row = styled.div` + display: flex; + flex-direction: column; +`; + +const Confirmation = (props: Props) => ( + + props.onReceiveConfirmation(false)}> + + +

Your Trezor is not backed up

+ + If your device is ever lost or damaged, your funds will be lost. Backup your device first, to protect your coins against such events. + + + props.onReceiveConfirmation(false)}>Create a backup in 3 minutes + + props.onReceiveConfirmation(true)}>Show address, I will take the risk + +
+); + +Confirmation.propTypes = { + onReceiveConfirmation: PropTypes.func.isRequired, +}; + +export default Confirmation; \ No newline at end of file diff --git a/src/constants/urls.js b/src/constants/urls.js new file mode 100644 index 00000000..3596f29e --- /dev/null +++ b/src/constants/urls.js @@ -0,0 +1,5 @@ +export default { + NEXT_WALLET: 'https://beta-wallet.trezor.io/next', + OLD_WALLET: 'https://wallet.trezor.io', + OLD_WALLET_BETA: 'https://beta-wallet.trezor.io', +}; \ No newline at end of file diff --git a/src/views/Wallet/views/DeviceSettings/index.js b/src/views/Wallet/views/DeviceSettings/index.js index 019a6fbe..223c9fa6 100644 --- a/src/views/Wallet/views/DeviceSettings/index.js +++ b/src/views/Wallet/views/DeviceSettings/index.js @@ -7,6 +7,7 @@ import Button from 'components/Button'; import P from 'components/Paragraph'; import Link from 'components/Link'; import ICONS from 'config/icons'; +import urlConstants from 'constants/urls'; import Content from 'views/Wallet/components/Content'; import { connect } from 'react-redux'; @@ -43,7 +44,7 @@ const DeviceSettings = () => ( /> Device settings is under construction Please use Bitcoin wallet interface to change your device settings - + diff --git a/src/views/Wallet/views/FirmwareUpdate/index.js b/src/views/Wallet/views/FirmwareUpdate/index.js index 31e1da69..0a5c604e 100644 --- a/src/views/Wallet/views/FirmwareUpdate/index.js +++ b/src/views/Wallet/views/FirmwareUpdate/index.js @@ -3,6 +3,7 @@ import React from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; +import urlConstants from 'constants/urls'; import styled from 'styled-components'; import { H1 } from 'components/Heading'; @@ -50,9 +51,9 @@ const StyledP = styled(P)` `; const getFirmwareReleaseLink = (device: ?TrezorDevice): string => { - if (!device || !device.firmwareRelease) return 'https://beta-wallet.trezor.io'; + if (!device || !device.firmwareRelease) return urlConstants.OLD_WALLET_BETA; const release = device.firmwareRelease; - const url = release.channel === 'beta' ? 'https://beta-wallet.trezor.io/' : 'https://wallet.trezor.io/'; + const url = release.channel === 'beta' ? urlConstants.OLD_WALLET_BETA : urlConstants.OLD_WALLET; const version = release.version.join('.'); return `${url}?fw=${version}`; }; diff --git a/src/views/Wallet/views/Initialize/index.js b/src/views/Wallet/views/Initialize/index.js index 12d1ea60..1b266678 100644 --- a/src/views/Wallet/views/Initialize/index.js +++ b/src/views/Wallet/views/Initialize/index.js @@ -1,6 +1,7 @@ import styled from 'styled-components'; import { H1 } from 'components/Heading'; import Button from 'components/Button'; +import urlConstants from 'constants/urls'; import Paragraph from 'components/Paragraph'; import React from 'react'; import { connect } from 'react-redux'; @@ -30,7 +31,7 @@ const Initialize = () => (

Your device is not initialized

Please use Bitcoin wallet interface to start initialization process - +
From 44f5f62566943dca9492e1e1ca3421ea40138909 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 26 Feb 2019 14:18:23 +0100 Subject: [PATCH 6/8] Added correct url for old beta/stable wallet --- .../modals/confirm/UnverifiedAddress/index.js | 4 ++-- src/utils/url.js | 24 +++++++++++++++++++ .../Wallet/views/DeviceSettings/index.js | 13 +++++++--- .../Wallet/views/FirmwareUpdate/index.js | 12 ++-------- src/views/Wallet/views/Initialize/index.js | 13 +++++++--- src/views/Wallet/views/NoBackup/index.js | 13 ++++++---- yarn.lock | 7 ++++++ 7 files changed, 64 insertions(+), 22 deletions(-) create mode 100644 src/utils/url.js diff --git a/src/components/modals/confirm/UnverifiedAddress/index.js b/src/components/modals/confirm/UnverifiedAddress/index.js index dec2098f..04e8059b 100644 --- a/src/components/modals/confirm/UnverifiedAddress/index.js +++ b/src/components/modals/confirm/UnverifiedAddress/index.js @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import styled from 'styled-components'; - +import { getOldWalletUrl } from 'utils/url'; import icons from 'config/icons'; import colors from 'config/colors'; @@ -151,7 +151,7 @@ class ConfirmUnverifiedAddress extends PureComponent { - + Create a backup in 3 minutes diff --git a/src/utils/url.js b/src/utils/url.js new file mode 100644 index 00000000..e4ca9992 --- /dev/null +++ b/src/utils/url.js @@ -0,0 +1,24 @@ +/* @flow */ +import urlConstants from 'constants/urls'; +import type { TrezorDevice } from 'flowtype'; + +const getOldWalletUrl = (device: ?TrezorDevice): string => { + if (!device) return urlConstants.OLD_WALLET_BETA; + const release = device.firmwareRelease; + const url = release.channel === 'beta' ? urlConstants.OLD_WALLET_BETA : urlConstants.OLD_WALLET; + return url; +}; + +// TODO: use uri template to build urls +const getOldWalletReleaseUrl = (device: ?TrezorDevice): string => { + if (!device || !device.firmwareRelease) return urlConstants.OLD_WALLET_BETA; + const release = device.firmwareRelease; + const url = getOldWalletUrl(device); + const version = release.version.join('.'); + return `${url}?fw=${version}`; +}; + +export { + getOldWalletUrl, + getOldWalletReleaseUrl, +}; \ No newline at end of file diff --git a/src/views/Wallet/views/DeviceSettings/index.js b/src/views/Wallet/views/DeviceSettings/index.js index 223c9fa6..6874297e 100644 --- a/src/views/Wallet/views/DeviceSettings/index.js +++ b/src/views/Wallet/views/DeviceSettings/index.js @@ -1,3 +1,4 @@ +/* @flow */ import React from 'react'; import styled from 'styled-components'; import { H1 } from 'components/Heading'; @@ -7,10 +8,16 @@ import Button from 'components/Button'; import P from 'components/Paragraph'; import Link from 'components/Link'; import ICONS from 'config/icons'; -import urlConstants from 'constants/urls'; +import { getOldWalletUrl } from 'utils/url'; import Content from 'views/Wallet/components/Content'; import { connect } from 'react-redux'; +import type { TrezorDevice } from 'flowtype'; + +type Props = { + device: ?TrezorDevice; +} + const Section = styled.section` display: flex; flex-direction: column; @@ -33,7 +40,7 @@ const StyledH1 = styled(H1)` text-align: center; `; -const DeviceSettings = () => ( +const DeviceSettings = (props: Props) => (
@@ -44,7 +51,7 @@ const DeviceSettings = () => ( /> Device settings is under construction Please use Bitcoin wallet interface to change your device settings - + diff --git a/src/views/Wallet/views/FirmwareUpdate/index.js b/src/views/Wallet/views/FirmwareUpdate/index.js index 0a5c604e..40fad54e 100644 --- a/src/views/Wallet/views/FirmwareUpdate/index.js +++ b/src/views/Wallet/views/FirmwareUpdate/index.js @@ -3,7 +3,7 @@ import React from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; -import urlConstants from 'constants/urls'; +import { getOldWalletReleaseUrl } from 'utils/url'; import styled from 'styled-components'; import { H1 } from 'components/Heading'; @@ -50,14 +50,6 @@ const StyledP = styled(P)` text-align: center; `; -const getFirmwareReleaseLink = (device: ?TrezorDevice): string => { - if (!device || !device.firmwareRelease) return urlConstants.OLD_WALLET_BETA; - const release = device.firmwareRelease; - const url = release.channel === 'beta' ? urlConstants.OLD_WALLET_BETA : urlConstants.OLD_WALLET; - const version = release.version.join('.'); - return `${url}?fw=${version}`; -}; - const FirmwareUpdate = (props: Props) => ( @@ -138,7 +130,7 @@ const FirmwareUpdate = (props: Props) => (

It’s time to update your firmware

Please use Bitcoin wallet interface to update your firmware. - + {deviceUtils.isDeviceAccessible(props.device) && ( diff --git a/src/views/Wallet/views/Initialize/index.js b/src/views/Wallet/views/Initialize/index.js index 1b266678..2447c7f6 100644 --- a/src/views/Wallet/views/Initialize/index.js +++ b/src/views/Wallet/views/Initialize/index.js @@ -1,11 +1,18 @@ +/* @flow */ import styled from 'styled-components'; import { H1 } from 'components/Heading'; import Button from 'components/Button'; -import urlConstants from 'constants/urls'; +import { getOldWalletUrl } from 'utils/url'; import Paragraph from 'components/Paragraph'; import React from 'react'; import { connect } from 'react-redux'; +import type { TrezorDevice } from 'flowtype'; + +type Props = { + device: ?TrezorDevice; +} + const Wrapper = styled.div` display: flex; flex-direction: column; @@ -26,12 +33,12 @@ const StyledParagraph = styled(Paragraph)` text-align: center; `; -const Initialize = () => ( +const Initialize = (props: Props) => (

Your device is not initialized

Please use Bitcoin wallet interface to start initialization process - +
diff --git a/src/views/Wallet/views/NoBackup/index.js b/src/views/Wallet/views/NoBackup/index.js index 62d2b982..f34dfd61 100644 --- a/src/views/Wallet/views/NoBackup/index.js +++ b/src/views/Wallet/views/NoBackup/index.js @@ -1,17 +1,22 @@ /* @flow */ - import React from 'react'; import styled from 'styled-components'; import { H1 } from 'components/Heading'; import P from 'components/Paragraph'; import Link from 'components/Link'; +import { getOldWalletUrl } from 'utils/url'; import Button from 'components/Button'; import Icon from 'components/Icon'; - import { FONT_SIZE } from 'config/variables'; import colors from 'config/colors'; import icons from 'config/icons'; +import type { TrezorDevice } from 'flowtype'; + +type Props = { + device: ?TrezorDevice; +} + const Wrapper = styled.section` display: flex; flex-direction: column; @@ -40,7 +45,7 @@ const Message = styled.div` padding: 0 0 15px 0; `; -const FirmwareUpdate = () => ( +const FirmwareUpdate = (props: Props) => ( ( If your device is ever lost or damaged, your funds will be lost. Backup your device first, to protect your coins against such events.

Please use Bitcoin wallet interface to create a backup.

- + I’ll do that later. diff --git a/yarn.lock b/yarn.lock index 32b11a19..f75446a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -738,6 +738,13 @@ dependencies: regenerator-runtime "^0.12.0" +"@babel/runtime@^7.3.1": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.3.4.tgz#73d12ba819e365fcf7fd152aed56d6df97d21c83" + integrity sha512-IvfvnMdSaLBateu0jfsYIpZTxAc2cKEXEMiezGGN75QcBcecDUKd3PgLAncT0oOgxKy8dd8hrJKj9MfzgfZd6g== + dependencies: + regenerator-runtime "^0.12.0" + "@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": version "7.2.2" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" From 3b7b2a4b82ff8c37959e03a533a240b66dab259f Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 26 Feb 2019 14:20:52 +0100 Subject: [PATCH 7/8] Fix url in modal --- src/components/modals/confirm/NoBackup/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/modals/confirm/NoBackup/index.js b/src/components/modals/confirm/NoBackup/index.js index 61d04230..b94af096 100644 --- a/src/components/modals/confirm/NoBackup/index.js +++ b/src/components/modals/confirm/NoBackup/index.js @@ -5,7 +5,7 @@ import PropTypes from 'prop-types'; import styled from 'styled-components'; import icons from 'config/icons'; -import urlConstants from 'constants/urls'; +import { getOldWalletUrl } from 'utils/url'; import colors from 'config/colors'; import { H2 } from 'components/Heading'; @@ -14,10 +14,12 @@ import Icon from 'components/Icon'; import Button from 'components/Button'; import Link from 'components/Link'; +import type { TrezorDevice } from 'flowtype'; import type { Props as BaseProps } from '../../Container'; type Props = { onReceiveConfirmation: $ElementType<$ElementType, 'onReceiveConfirmation'>; + device: ?TrezorDevice; } const Wrapper = styled.div` @@ -68,7 +70,7 @@ const Confirmation = (props: Props) => ( If your device is ever lost or damaged, your funds will be lost. Backup your device first, to protect your coins against such events. - + props.onReceiveConfirmation(false)}>Create a backup in 3 minutes props.onReceiveConfirmation(true)}>Show address, I will take the risk From 6c35db4a06ca5bebe8cd525c7710d8a5fd9bada0 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Tue, 26 Feb 2019 14:50:54 +0100 Subject: [PATCH 8/8] Fix flow --- src/components/modals/index.js | 4 ++-- src/utils/url.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/modals/index.js b/src/components/modals/index.js index 7fcb70db..4c98ae9d 100644 --- a/src/components/modals/index.js +++ b/src/components/modals/index.js @@ -191,13 +191,13 @@ const getQrModal = (props: Props) => { }; const getConfirmationModal = (props: Props) => { - const { modal, modalActions } = props; + const { modal, modalActions, wallet } = props; if (modal.context !== MODAL.CONTEXT_CONFIRMATION) return null; switch (modal.windowType) { case 'no-backup': - return (); + return (); default: return null; } diff --git a/src/utils/url.js b/src/utils/url.js index e4ca9992..b59a2991 100644 --- a/src/utils/url.js +++ b/src/utils/url.js @@ -3,7 +3,7 @@ import urlConstants from 'constants/urls'; import type { TrezorDevice } from 'flowtype'; const getOldWalletUrl = (device: ?TrezorDevice): string => { - if (!device) return urlConstants.OLD_WALLET_BETA; + if (!device || !device.firmwareRelease) return urlConstants.OLD_WALLET_BETA; const release = device.firmwareRelease; const url = release.channel === 'beta' ? urlConstants.OLD_WALLET_BETA : urlConstants.OLD_WALLET; return url;