From 78f29b795eecfb5d38cf3fc9ebe6841bfd8d42f6 Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Tue, 19 Sep 2017 20:14:15 +0300 Subject: [PATCH] AGP-215, Added notice to user if QR-code has different coin than active wallet coin --- react/src/components/dashboard/sendCoin/sendCoin.js | 12 ++++++++++++ .../dashboard/walletsNativeSend/walletsNativeSend.js | 12 ++++++++++++ react/src/translate/en.js | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index c4504fe..c97cd2b 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -83,6 +83,18 @@ class SendCoin extends React.Component { sendTo: recObj.address, }); } + } else { + Store.dispatch( + triggerToaster( + translate('SEND.QR_COIN_MISMATCH_MESSAGE_IMPORT_COIN') + + recObj.coin + + translate('SEND.QR_COIN_MISMATCH_MESSAGE_ACTIVE_COIN') + + this.props.ActiveCoin.coin + + translate('SEND.QR_COIN_MISMATCH_MESSAGE_END'), + translate('SEND.QR_COIN_MISMATCH_TITLE'), + 'warning' + ) + ); } } } catch (e) { diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js index e5acb5b..8767c7d 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js @@ -97,6 +97,18 @@ class WalletsNativeSend extends React.Component { sendTo: recObj.address, }); } + } else { + Store.dispatch( + triggerToaster( + translate('SEND.QR_COIN_MISMATCH_MESSAGE_IMPORT_COIN') + + recObj.coin + + translate('SEND.QR_COIN_MISMATCH_MESSAGE_ACTIVE_COIN') + + this.props.ActiveCoin.coin + + translate('SEND.QR_COIN_MISMATCH_MESSAGE_END'), + translate('SEND.QR_COIN_MISMATCH_TITLE'), + 'warning' + ) + ); } } } catch (e) { diff --git a/react/src/translate/en.js b/react/src/translate/en.js index c95fd3f..a3c9d50 100644 --- a/react/src/translate/en.js +++ b/react/src/translate/en.js @@ -659,6 +659,10 @@ export const _lang = { 'TOTAL_AMOUNT_POSITIVE_NUMBER': 'Total amount (amount - fee) must be a positive number', 'INSUFFICIENT_FUNDS': 'You don\'t have the necessary funds to make this transaction', 'SELECT_SOURCE_ADDRESS': 'Select source (from) address', + 'QR_COIN_MISMATCH_MESSAGE_IMPORT_COIN': 'QR code had coin ', + 'QR_COIN_MISMATCH_MESSAGE_ACTIVE_COIN': '. You have ', + 'QR_COIN_MISMATCH_MESSAGE_END': ' active in your wallet. Please, check that you have same coin active that you try to import!', + 'QR_COIN_MISMATCH_TITLE': 'Coin Mismatch', }, 'FIAT_CURRENCIES': { 'AUD': 'Australian Dollar (AUD)',