From 164d07d1a3cad1f6284b0080484ed188bc75d825 Mon Sep 17 00:00:00 2001 From: Maxwell Lasky Date: Sun, 29 Nov 2020 10:23:45 -0700 Subject: [PATCH 1/5] Fixes translation typo and refactors FailedPanel.jsx --- .../NetworkConfigurationTooltip.test.js.snap | 4 +-- .../__snapshots__/NetworkSwitch.test.js.snap | 2 +- .../__snapshots__/News.test.js.snap | 2 +- .../__snapshots__/Settings.test.js.snap | 2 +- .../__snapshots__/Sidebar.test.js.snap | 2 +- app/actions/balancesActions.js | 2 ++ .../AssetBalancesPanel/AssetBalancesPanel.jsx | 3 +- .../Dashboard/AssetBalancesPanel/index.js | 3 +- app/components/FailedPanel/FailedPanel.jsx | 36 +++++++++++++------ app/components/FailedPanel/FailedPanel.scss | 12 ++++--- app/components/FailedPanel/index.js | 18 +++++++++- app/containers/Receive/index.js | 2 +- app/containers/Send/index.js | 2 +- app/containers/TransactionHistory/index.js | 2 +- app/hocs/withFailureNotification.js | 1 + app/hocs/withSuccessNotification.js | 2 ++ app/translations/arabic.js | 2 +- app/translations/chinese.js | 2 +- app/translations/english.js | 2 +- app/translations/french.js | 2 +- app/translations/german.js | 2 +- app/translations/italian.js | 2 +- app/translations/korean.js | 2 +- app/translations/portuguese.js | 2 +- app/translations/russian.js | 2 +- app/translations/turkish.js | 2 +- app/translations/vietnamese.js | 2 +- 27 files changed, 77 insertions(+), 40 deletions(-) diff --git a/__tests__/components/__snapshots__/NetworkConfigurationTooltip.test.js.snap b/__tests__/components/__snapshots__/NetworkConfigurationTooltip.test.js.snap index 5db3051d4..55c2ee1fe 100644 --- a/__tests__/components/__snapshots__/NetworkConfigurationTooltip.test.js.snap +++ b/__tests__/components/__snapshots__/NetworkConfigurationTooltip.test.js.snap @@ -181,7 +181,7 @@ exports[`Sidebar renders without crashing 1`] = ` "notifications.success.accountSaved": "Account saved!", "notifications.success.receivedBlockchainInfo": "Received latest blockchain information.", "notifications.success.updatedWalletName": "Succesfully updated wallet name.", - "notificiations.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", + "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending", "previousStep": "Previous Step", "print": "Print", @@ -828,7 +828,7 @@ exports[`Sidebar renders without crashing 1`] = ` "notifications.success.accountSaved": "Account saved!", "notifications.success.receivedBlockchainInfo": "Received latest blockchain information.", "notifications.success.updatedWalletName": "Succesfully updated wallet name.", - "notificiations.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", + "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending", "previousStep": "Previous Step", "print": "Print", diff --git a/__tests__/components/__snapshots__/NetworkSwitch.test.js.snap b/__tests__/components/__snapshots__/NetworkSwitch.test.js.snap index 490842689..93816cdc1 100644 --- a/__tests__/components/__snapshots__/NetworkSwitch.test.js.snap +++ b/__tests__/components/__snapshots__/NetworkSwitch.test.js.snap @@ -160,7 +160,7 @@ exports[`NetworkSwitch renders without crashing 1`] = ` "notifications.success.accountSaved": "Account saved!", "notifications.success.receivedBlockchainInfo": "Received latest blockchain information.", "notifications.success.updatedWalletName": "Succesfully updated wallet name.", - "notificiations.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", + "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending", "previousStep": "Previous Step", "print": "Print", diff --git a/__tests__/components/__snapshots__/News.test.js.snap b/__tests__/components/__snapshots__/News.test.js.snap index 910e12463..58e4b2bc4 100644 --- a/__tests__/components/__snapshots__/News.test.js.snap +++ b/__tests__/components/__snapshots__/News.test.js.snap @@ -178,7 +178,7 @@ exports[`News renders without crashing 1`] = ` "notifications.success.accountSaved": "Account saved!", "notifications.success.receivedBlockchainInfo": "Received latest blockchain information.", "notifications.success.updatedWalletName": "Succesfully updated wallet name.", - "notificiations.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", + "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending", "previousStep": "Previous Step", "print": "Print", diff --git a/__tests__/components/__snapshots__/Settings.test.js.snap b/__tests__/components/__snapshots__/Settings.test.js.snap index b147c343d..20100e9df 100644 --- a/__tests__/components/__snapshots__/Settings.test.js.snap +++ b/__tests__/components/__snapshots__/Settings.test.js.snap @@ -178,7 +178,7 @@ exports[`Settings renders without crashing 1`] = ` "notifications.success.accountSaved": "Account saved!", "notifications.success.receivedBlockchainInfo": "Received latest blockchain information.", "notifications.success.updatedWalletName": "Succesfully updated wallet name.", - "notificiations.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", + "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending", "previousStep": "Previous Step", "print": "Print", diff --git a/__tests__/components/__snapshots__/Sidebar.test.js.snap b/__tests__/components/__snapshots__/Sidebar.test.js.snap index 8777fcc40..c552886d5 100644 --- a/__tests__/components/__snapshots__/Sidebar.test.js.snap +++ b/__tests__/components/__snapshots__/Sidebar.test.js.snap @@ -178,7 +178,7 @@ exports[`Sidebar renders without crashing 1`] = ` "notifications.success.accountSaved": "Account saved!", "notifications.success.receivedBlockchainInfo": "Received latest blockchain information.", "notifications.success.updatedWalletName": "Succesfully updated wallet name.", - "notificiations.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", + "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending", "previousStep": "Previous Step", "print": "Print", diff --git a/app/actions/balancesActions.js b/app/actions/balancesActions.js index 4bce2df24..a17f59b42 100644 --- a/app/actions/balancesActions.js +++ b/app/actions/balancesActions.js @@ -12,6 +12,7 @@ import { ASSETS } from '../core/constants' import { COIN_DECIMAL_LENGTH } from '../core/formatters' import { toBigNumber } from '../core/math' import { findNetworkByDeprecatedLabel } from '../core/networks' +import delay from '../util/delay' const MAX_SCRIPT_HASH_CHUNK_SIZE = 10 @@ -73,6 +74,7 @@ function determineIfBalanceUpdated( } async function getBalances({ net, address }: Props) { + await delay(1000) const { soundEnabled, tokens } = await getSettings() const network = findNetworkByDeprecatedLabel(net) diff --git a/app/components/Dashboard/AssetBalancesPanel/AssetBalancesPanel.jsx b/app/components/Dashboard/AssetBalancesPanel/AssetBalancesPanel.jsx index f984df552..dd25c2480 100644 --- a/app/components/Dashboard/AssetBalancesPanel/AssetBalancesPanel.jsx +++ b/app/components/Dashboard/AssetBalancesPanel/AssetBalancesPanel.jsx @@ -24,6 +24,7 @@ type Props = { neoPriceChange: BigNumber, gasPriceChange: BigNumber, currencyCode: string, + loading: boolean, } export default class AssetBalancesPanel extends React.Component { @@ -32,7 +33,7 @@ export default class AssetBalancesPanel extends React.Component { } render = () => { - const { NEO, GAS, className } = this.props + const { NEO, GAS, className, loading } = this.props const hasAssets = NEO !== '0' || GAS !== '0' diff --git a/app/components/Dashboard/AssetBalancesPanel/index.js b/app/components/Dashboard/AssetBalancesPanel/index.js index d5edb81aa..7dd4f6297 100644 --- a/app/components/Dashboard/AssetBalancesPanel/index.js +++ b/app/components/Dashboard/AssetBalancesPanel/index.js @@ -6,7 +6,6 @@ import { values, omit, get } from 'lodash-es' import { withActions, withData } from 'spunky' import AssetBalancesPanel from './AssetBalancesPanel' -import assetBalancesPanelActions from '../../../actions/assetBalancesPanelActions' import balancesActions from '../../../actions/balancesActions' import priceHistoryActions from '../../../actions/priceHistoryActions' import withBalancesData from '../../../hocs/withBalancesData' @@ -66,7 +65,7 @@ export default compose( withNetworkData(), withAuthData(), withFilteredTokensData(), - withProgressPanel(assetBalancesPanelActions, { + withProgressPanel(balancesActions, { title: , }), withPricesData(mapPricesDataToProps), diff --git a/app/components/FailedPanel/FailedPanel.jsx b/app/components/FailedPanel/FailedPanel.jsx index 5ea4675d3..d6c731b5c 100644 --- a/app/components/FailedPanel/FailedPanel.jsx +++ b/app/components/FailedPanel/FailedPanel.jsx @@ -6,35 +6,49 @@ import { Link } from 'react-router-dom' import Panel from '../Panel' import styles from './FailedPanel.scss' import { ROUTES } from '../../core/constants' +import Loader from '../Loader' type Props = { className: ?string, title: ?string, onRetry: ?Function, + loading: boolean, } export default class LoadingPanel extends React.Component { static defaultProps = { title: 'Failed', onRetry: null, + loading: false, } render() { + const { loading, className } = this.props + return ( - Failed to load. {this.renderRetry()} or{' '} - - select a different node. - + {loading ? ( + + ) : ( + + Failed to load. {this.renderRetry()} or{' '} + + select a different node. + + + )} ) } diff --git a/app/components/FailedPanel/FailedPanel.scss b/app/components/FailedPanel/FailedPanel.scss index 9bcbce9cf..3fcb27ec2 100644 --- a/app/components/FailedPanel/FailedPanel.scss +++ b/app/components/FailedPanel/FailedPanel.scss @@ -1,6 +1,8 @@ -.failedPanel { - .content { - text-align: center; - vertical-align: middle; - } +.loadingContent { + text-align: center; + vertical-align: middle; + position: relative; + min-height: 100px; + text-align: center; + vertical-align: middle; } diff --git a/app/components/FailedPanel/index.js b/app/components/FailedPanel/index.js index d401b434e..c5b227814 100644 --- a/app/components/FailedPanel/index.js +++ b/app/components/FailedPanel/index.js @@ -1 +1,17 @@ -export { default } from './FailedPanel' +// @flow +import { compose } from 'recompose' + +import FailedPanel from './FailedPanel' +import balancesActions from '../../actions/balancesActions' +import withLoadingProp from '../../hocs/withLoadingProp' +import withFailureNotification from '../../hocs/withFailureNotification' + +export default compose( + withLoadingProp(balancesActions), + withFailureNotification( + balancesActions, + 'notifications.failure.blockchainInfoFailure', + {}, + true, + ), +)(FailedPanel) diff --git a/app/containers/Receive/index.js b/app/containers/Receive/index.js index a0e9c0c9c..c6cd8bd91 100644 --- a/app/containers/Receive/index.js +++ b/app/containers/Receive/index.js @@ -112,7 +112,7 @@ export default compose( ), withFailureNotification( balancesActions, - 'notificiations.failure.blockchainInfoFailure', + 'notifications.failure.blockchainInfoFailure', {}, true, ), diff --git a/app/containers/Send/index.js b/app/containers/Send/index.js index e402df277..8a02bc4a5 100644 --- a/app/containers/Send/index.js +++ b/app/containers/Send/index.js @@ -98,7 +98,7 @@ export default compose( ), withFailureNotification( balancesActions, - 'notificiations.failure.blockchainInfoFailure', + 'notifications.failure.blockchainInfoFailure', {}, true, ), diff --git a/app/containers/TransactionHistory/index.js b/app/containers/TransactionHistory/index.js index 9bf366446..06c3bde8a 100644 --- a/app/containers/TransactionHistory/index.js +++ b/app/containers/TransactionHistory/index.js @@ -46,7 +46,7 @@ export default compose( ), withFailureNotification( balancesActions, - 'notificiations.failure.blockchainInfoFailure', + 'notifications.failure.blockchainInfoFailure', {}, true, ), diff --git a/app/hocs/withFailureNotification.js b/app/hocs/withFailureNotification.js index 4c6c5204f..005c9ef4b 100644 --- a/app/hocs/withFailureNotification.js +++ b/app/hocs/withFailureNotification.js @@ -53,6 +53,7 @@ export default function withFailureNotification( class ErrorNotifier extends React.Component { componentWillReceiveProps(nextProps) { + console.log(nextProps) const { intl } = this.props if ( diff --git a/app/hocs/withSuccessNotification.js b/app/hocs/withSuccessNotification.js index aa3c92726..134a5b037 100644 --- a/app/hocs/withSuccessNotification.js +++ b/app/hocs/withSuccessNotification.js @@ -32,6 +32,7 @@ export default function withSuccessNotification( options: Object = {}, isTranslation?: boolean, ) { + console.log(arguments) const mapDispatchToProps = (dispatch: DispatchType) => ({ [NOTIFICATION_PROP]: (...args) => dispatch(showSuccessNotification(...args)), @@ -43,6 +44,7 @@ export default function withSuccessNotification( class LoadedNotifier extends React.Component { componentWillReceiveProps(nextProps) { + console.log(nextProps) if (progressChangedToLoaded(this.props, nextProps)) { const { intl } = this.props const showSuccessNotification = nextProps[NOTIFICATION_PROP] diff --git a/app/translations/arabic.js b/app/translations/arabic.js index 7af66e75b..e84edb2a7 100644 --- a/app/translations/arabic.js +++ b/app/translations/arabic.js @@ -138,7 +138,7 @@ const NOTIFICATIONS = { 'تلقي أحدث معلومات blockchain.', 'notifications.success.accountSaved': 'تم حفظ الحساب!', 'notifications.success.updatedWalletName': 'تم تحديث اسم المحفظة بنجاح.', - 'notificiations.failure.blockchainInfoFailure': + 'notifications.failure.blockchainInfoFailure': 'فشل في استعادة معلومات blockchain.', } diff --git a/app/translations/chinese.js b/app/translations/chinese.js index 6cb269b08..4f42b35eb 100644 --- a/app/translations/chinese.js +++ b/app/translations/chinese.js @@ -128,7 +128,7 @@ const NOTIFICATIONS = { 'notifications.success.receivedBlockchainInfo': '收到最新的区块链信息。', 'notifications.success.accountSaved': '帐户已保存!', 'notifications.success.updatedWalletName': '成功更新了钱包名称.', - 'notificiations.failure.blockchainInfoFailure': '检索区块链信息失败。', + 'notifications.failure.blockchainInfoFailure': '检索区块链信息失败。', } const AUTH = { diff --git a/app/translations/english.js b/app/translations/english.js index b14ef7803..a74e45bf2 100644 --- a/app/translations/english.js +++ b/app/translations/english.js @@ -141,7 +141,7 @@ const NOTIFICATIONS = { 'Received latest blockchain information.', 'notifications.success.accountSaved': 'Account saved!', 'notifications.success.updatedWalletName': 'Succesfully updated wallet name.', - 'notificiations.failure.blockchainInfoFailure': + 'notifications.failure.blockchainInfoFailure': 'Failed to retrieve blockchain information.', } diff --git a/app/translations/french.js b/app/translations/french.js index 621c5fae6..dadaadf26 100644 --- a/app/translations/french.js +++ b/app/translations/french.js @@ -133,7 +133,7 @@ const NOTIFICATIONS = { 'notifications.success.accountSaved': 'Compte enregistré!', 'notifications.success.updatedWalletName': 'Nom du portefeuille mis à jour avec succès.', - 'notificiations.failure.blockchainInfoFailure': + 'notifications.failure.blockchainInfoFailure': 'Échec de la récupération des informations de la chaîne de blocs.', } diff --git a/app/translations/german.js b/app/translations/german.js index c4b1d4eaa..d1162edb5 100644 --- a/app/translations/german.js +++ b/app/translations/german.js @@ -141,7 +141,7 @@ const NOTIFICATIONS = { 'notifications.success.accountSaved': 'Konto gespeichert!', 'notifications.success.updatedWalletName': 'Erfolgreich aktualisierter Brieftaschenname.', - 'notificiations.failure.blockchainInfoFailure': + 'notifications.failure.blockchainInfoFailure': 'Fehler beim Abrufen der Blockchain-Informationen.', } diff --git a/app/translations/italian.js b/app/translations/italian.js index cc909b553..ae092ad40 100644 --- a/app/translations/italian.js +++ b/app/translations/italian.js @@ -136,7 +136,7 @@ const NOTIFICATIONS = { 'notifications.success.accountSaved': 'Account salvato!', 'notifications.success.updatedWalletName': 'Nome del portafoglio aggiornato con successo.', - 'notificiations.failure.blockchainInfoFailure': + 'notifications.failure.blockchainInfoFailure': 'Impossibile recuperare le informazioni sulla blockchain.', } diff --git a/app/translations/korean.js b/app/translations/korean.js index da7a9d24d..c957caf48 100644 --- a/app/translations/korean.js +++ b/app/translations/korean.js @@ -124,7 +124,7 @@ const NOTIFICATIONS = { 'notifications.success.accountSaved': '계정이 저장되었습니다!', 'notifications.success.updatedWalletName': '지갑 이름이 성공적으로 업데이트되었습니다.', - 'notificiations.failure.blockchainInfoFailure': + 'notifications.failure.blockchainInfoFailure': '블록 체인 정보를 검색하지 못했습니다.', } diff --git a/app/translations/portuguese.js b/app/translations/portuguese.js index 255ca4d3c..eb165072e 100644 --- a/app/translations/portuguese.js +++ b/app/translations/portuguese.js @@ -143,7 +143,7 @@ const NOTIFICATIONS = { 'notifications.success.accountSaved': 'Conta salva!', 'notifications.success.updatedWalletName': 'Nome do portfólio atualizado com sucesso.', - 'notificiations.failure.blockchainInfoFailure': + 'notifications.failure.blockchainInfoFailure': 'Falha ao recuperar as informações da blockchain.', } diff --git a/app/translations/russian.js b/app/translations/russian.js index 831d74028..befd83b2f 100644 --- a/app/translations/russian.js +++ b/app/translations/russian.js @@ -142,7 +142,7 @@ const NOTIFICATIONS = { 'notifications.success.accountSaved': 'Аккаунт сохранен!', 'notifications.success.updatedWalletName': 'Название кошелька успешно обновлено.', - 'notificiations.failure.blockchainInfoFailure': + 'notifications.failure.blockchainInfoFailure': 'В процессе получения информации о блокчейне произошла ошибка.', } diff --git a/app/translations/turkish.js b/app/translations/turkish.js index 78138364e..07a76c42f 100644 --- a/app/translations/turkish.js +++ b/app/translations/turkish.js @@ -137,7 +137,7 @@ const NOTIFICATIONS = { 'notifications.success.accountSaved': 'Hesap kaydedildi!', 'notifications.success.updatedWalletName': 'Cüzdan adı başarıyla güncellendi.', - 'notificiations.failure.blockchainInfoFailure': + 'notifications.failure.blockchainInfoFailure': 'Blockchain bilgileri alınamadı.', } diff --git a/app/translations/vietnamese.js b/app/translations/vietnamese.js index 5728c4f74..0cea9cb28 100644 --- a/app/translations/vietnamese.js +++ b/app/translations/vietnamese.js @@ -133,7 +133,7 @@ const NOTIFICATIONS = { 'Nhận được thông tin blockchain mới nhất.', 'notifications.success.accountSaved': 'Tài khoản đã được lưu!', 'notifications.success.updatedWalletName': 'Tên ví được cập nhật thành công.', - 'notificiations.failure.blockchainInfoFailure': + 'notifications.failure.blockchainInfoFailure': 'Không thể truy xuất thông tin blockchain.', } From f7b0610bac54cbbd785ec2374eaea0697d14ac5b Mon Sep 17 00:00:00 2001 From: Maxwell Lasky Date: Sun, 29 Nov 2020 10:26:18 -0700 Subject: [PATCH 2/5] lint --- .../Dashboard/AssetBalancesPanel/AssetBalancesPanel.jsx | 3 +-- app/components/Dashboard/AssetBalancesPanel/index.js | 2 -- app/hocs/withFailureNotification.js | 1 - app/hocs/withSuccessNotification.js | 2 -- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/components/Dashboard/AssetBalancesPanel/AssetBalancesPanel.jsx b/app/components/Dashboard/AssetBalancesPanel/AssetBalancesPanel.jsx index dd25c2480..f984df552 100644 --- a/app/components/Dashboard/AssetBalancesPanel/AssetBalancesPanel.jsx +++ b/app/components/Dashboard/AssetBalancesPanel/AssetBalancesPanel.jsx @@ -24,7 +24,6 @@ type Props = { neoPriceChange: BigNumber, gasPriceChange: BigNumber, currencyCode: string, - loading: boolean, } export default class AssetBalancesPanel extends React.Component { @@ -33,7 +32,7 @@ export default class AssetBalancesPanel extends React.Component { } render = () => { - const { NEO, GAS, className, loading } = this.props + const { NEO, GAS, className } = this.props const hasAssets = NEO !== '0' || GAS !== '0' diff --git a/app/components/Dashboard/AssetBalancesPanel/index.js b/app/components/Dashboard/AssetBalancesPanel/index.js index 7dd4f6297..9de3d825e 100644 --- a/app/components/Dashboard/AssetBalancesPanel/index.js +++ b/app/components/Dashboard/AssetBalancesPanel/index.js @@ -11,7 +11,6 @@ import priceHistoryActions from '../../../actions/priceHistoryActions' import withBalancesData from '../../../hocs/withBalancesData' import withCurrencyData from '../../../hocs/withCurrencyData' import withPricesData from '../../../hocs/withPricesData' -import withLoadingProp from '../../../hocs/withLoadingProp' import withProgressPanel from '../../../hocs/withProgressPanel' import withSuccessNotification from '../../../hocs/withSuccessNotification' import withFailureNotification from '../../../hocs/withFailureNotification' @@ -74,7 +73,6 @@ export default compose( // Expose data & functionality needed for `refresh` action. withActions(balancesActions, mapBalancesActionsToProps), - withLoadingProp(balancesActions), withSuccessNotification( balancesActions, 'notifications.success.receivedBlockchainInfo', diff --git a/app/hocs/withFailureNotification.js b/app/hocs/withFailureNotification.js index 005c9ef4b..4c6c5204f 100644 --- a/app/hocs/withFailureNotification.js +++ b/app/hocs/withFailureNotification.js @@ -53,7 +53,6 @@ export default function withFailureNotification( class ErrorNotifier extends React.Component { componentWillReceiveProps(nextProps) { - console.log(nextProps) const { intl } = this.props if ( diff --git a/app/hocs/withSuccessNotification.js b/app/hocs/withSuccessNotification.js index 134a5b037..aa3c92726 100644 --- a/app/hocs/withSuccessNotification.js +++ b/app/hocs/withSuccessNotification.js @@ -32,7 +32,6 @@ export default function withSuccessNotification( options: Object = {}, isTranslation?: boolean, ) { - console.log(arguments) const mapDispatchToProps = (dispatch: DispatchType) => ({ [NOTIFICATION_PROP]: (...args) => dispatch(showSuccessNotification(...args)), @@ -44,7 +43,6 @@ export default function withSuccessNotification( class LoadedNotifier extends React.Component { componentWillReceiveProps(nextProps) { - console.log(nextProps) if (progressChangedToLoaded(this.props, nextProps)) { const { intl } = this.props const showSuccessNotification = nextProps[NOTIFICATION_PROP] From 95e489a1620239bdc3543f4ab3964635847a7716 Mon Sep 17 00:00:00 2001 From: Maxwell Lasky Date: Sun, 29 Nov 2020 10:31:23 -0700 Subject: [PATCH 3/5] snapshots --- .../__snapshots__/NetworkConfigurationTooltip.test.js.snap | 4 ++-- __tests__/components/__snapshots__/NetworkSwitch.test.js.snap | 2 +- __tests__/components/__snapshots__/News.test.js.snap | 2 +- __tests__/components/__snapshots__/Settings.test.js.snap | 2 +- __tests__/components/__snapshots__/Sidebar.test.js.snap | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/__tests__/components/__snapshots__/NetworkConfigurationTooltip.test.js.snap b/__tests__/components/__snapshots__/NetworkConfigurationTooltip.test.js.snap index 55c2ee1fe..ea6370292 100644 --- a/__tests__/components/__snapshots__/NetworkConfigurationTooltip.test.js.snap +++ b/__tests__/components/__snapshots__/NetworkConfigurationTooltip.test.js.snap @@ -178,10 +178,10 @@ exports[`Sidebar renders without crashing 1`] = ` "nodeSelectSelectAutomatically": "Select automatically", "nodeSelectionInstructions": "If you’re experiencing performance issues, try selecting a custom node below", "nothingToSeeHere": "Nothing to see here!", + "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "notifications.success.accountSaved": "Account saved!", "notifications.success.receivedBlockchainInfo": "Received latest blockchain information.", "notifications.success.updatedWalletName": "Succesfully updated wallet name.", - "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending", "previousStep": "Previous Step", "print": "Print", @@ -825,10 +825,10 @@ exports[`Sidebar renders without crashing 1`] = ` "nodeSelectSelectAutomatically": "Select automatically", "nodeSelectionInstructions": "If you’re experiencing performance issues, try selecting a custom node below", "nothingToSeeHere": "Nothing to see here!", + "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "notifications.success.accountSaved": "Account saved!", "notifications.success.receivedBlockchainInfo": "Received latest blockchain information.", "notifications.success.updatedWalletName": "Succesfully updated wallet name.", - "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending", "previousStep": "Previous Step", "print": "Print", diff --git a/__tests__/components/__snapshots__/NetworkSwitch.test.js.snap b/__tests__/components/__snapshots__/NetworkSwitch.test.js.snap index 93816cdc1..ff1f7a5f0 100644 --- a/__tests__/components/__snapshots__/NetworkSwitch.test.js.snap +++ b/__tests__/components/__snapshots__/NetworkSwitch.test.js.snap @@ -157,10 +157,10 @@ exports[`NetworkSwitch renders without crashing 1`] = ` "nodeSelectSelectAutomatically": "Select automatically", "nodeSelectionInstructions": "If you’re experiencing performance issues, try selecting a custom node below", "nothingToSeeHere": "Nothing to see here!", + "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "notifications.success.accountSaved": "Account saved!", "notifications.success.receivedBlockchainInfo": "Received latest blockchain information.", "notifications.success.updatedWalletName": "Succesfully updated wallet name.", - "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending", "previousStep": "Previous Step", "print": "Print", diff --git a/__tests__/components/__snapshots__/News.test.js.snap b/__tests__/components/__snapshots__/News.test.js.snap index 58e4b2bc4..047727e34 100644 --- a/__tests__/components/__snapshots__/News.test.js.snap +++ b/__tests__/components/__snapshots__/News.test.js.snap @@ -175,10 +175,10 @@ exports[`News renders without crashing 1`] = ` "nodeSelectSelectAutomatically": "Select automatically", "nodeSelectionInstructions": "If you’re experiencing performance issues, try selecting a custom node below", "nothingToSeeHere": "Nothing to see here!", + "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "notifications.success.accountSaved": "Account saved!", "notifications.success.receivedBlockchainInfo": "Received latest blockchain information.", "notifications.success.updatedWalletName": "Succesfully updated wallet name.", - "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending", "previousStep": "Previous Step", "print": "Print", diff --git a/__tests__/components/__snapshots__/Settings.test.js.snap b/__tests__/components/__snapshots__/Settings.test.js.snap index 20100e9df..a8ac8f26a 100644 --- a/__tests__/components/__snapshots__/Settings.test.js.snap +++ b/__tests__/components/__snapshots__/Settings.test.js.snap @@ -175,10 +175,10 @@ exports[`Settings renders without crashing 1`] = ` "nodeSelectSelectAutomatically": "Select automatically", "nodeSelectionInstructions": "If you’re experiencing performance issues, try selecting a custom node below", "nothingToSeeHere": "Nothing to see here!", + "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "notifications.success.accountSaved": "Account saved!", "notifications.success.receivedBlockchainInfo": "Received latest blockchain information.", "notifications.success.updatedWalletName": "Succesfully updated wallet name.", - "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending", "previousStep": "Previous Step", "print": "Print", diff --git a/__tests__/components/__snapshots__/Sidebar.test.js.snap b/__tests__/components/__snapshots__/Sidebar.test.js.snap index c552886d5..cd1d63215 100644 --- a/__tests__/components/__snapshots__/Sidebar.test.js.snap +++ b/__tests__/components/__snapshots__/Sidebar.test.js.snap @@ -175,10 +175,10 @@ exports[`Sidebar renders without crashing 1`] = ` "nodeSelectSelectAutomatically": "Select automatically", "nodeSelectionInstructions": "If you’re experiencing performance issues, try selecting a custom node below", "nothingToSeeHere": "Nothing to see here!", + "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "notifications.success.accountSaved": "Account saved!", "notifications.success.receivedBlockchainInfo": "Received latest blockchain information.", "notifications.success.updatedWalletName": "Succesfully updated wallet name.", - "notifications.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.", "numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending", "previousStep": "Previous Step", "print": "Print", From b7614f973bd09f7dc63a9d66caa188ab4f5fa638 Mon Sep 17 00:00:00 2001 From: Maxwell Lasky Date: Sun, 29 Nov 2020 10:35:52 -0700 Subject: [PATCH 4/5] Revert testing changes to balancesActions.js --- app/actions/balancesActions.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/actions/balancesActions.js b/app/actions/balancesActions.js index a17f59b42..4bce2df24 100644 --- a/app/actions/balancesActions.js +++ b/app/actions/balancesActions.js @@ -12,7 +12,6 @@ import { ASSETS } from '../core/constants' import { COIN_DECIMAL_LENGTH } from '../core/formatters' import { toBigNumber } from '../core/math' import { findNetworkByDeprecatedLabel } from '../core/networks' -import delay from '../util/delay' const MAX_SCRIPT_HASH_CHUNK_SIZE = 10 @@ -74,7 +73,6 @@ function determineIfBalanceUpdated( } async function getBalances({ net, address }: Props) { - await delay(1000) const { soundEnabled, tokens } = await getSettings() const network = findNetworkByDeprecatedLabel(net) From 400f8924ce3524af947461cba3fcd9c24b200545 Mon Sep 17 00:00:00 2001 From: Maxwell Lasky Date: Sun, 29 Nov 2020 10:37:20 -0700 Subject: [PATCH 5/5] revert changes to AssetBalancesPanel/index.js --- app/components/Dashboard/AssetBalancesPanel/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/components/Dashboard/AssetBalancesPanel/index.js b/app/components/Dashboard/AssetBalancesPanel/index.js index 9de3d825e..d5edb81aa 100644 --- a/app/components/Dashboard/AssetBalancesPanel/index.js +++ b/app/components/Dashboard/AssetBalancesPanel/index.js @@ -6,11 +6,13 @@ import { values, omit, get } from 'lodash-es' import { withActions, withData } from 'spunky' import AssetBalancesPanel from './AssetBalancesPanel' +import assetBalancesPanelActions from '../../../actions/assetBalancesPanelActions' import balancesActions from '../../../actions/balancesActions' import priceHistoryActions from '../../../actions/priceHistoryActions' import withBalancesData from '../../../hocs/withBalancesData' import withCurrencyData from '../../../hocs/withCurrencyData' import withPricesData from '../../../hocs/withPricesData' +import withLoadingProp from '../../../hocs/withLoadingProp' import withProgressPanel from '../../../hocs/withProgressPanel' import withSuccessNotification from '../../../hocs/withSuccessNotification' import withFailureNotification from '../../../hocs/withFailureNotification' @@ -64,7 +66,7 @@ export default compose( withNetworkData(), withAuthData(), withFilteredTokensData(), - withProgressPanel(balancesActions, { + withProgressPanel(assetBalancesPanelActions, { title: , }), withPricesData(mapPricesDataToProps), @@ -73,6 +75,7 @@ export default compose( // Expose data & functionality needed for `refresh` action. withActions(balancesActions, mapBalancesActionsToProps), + withLoadingProp(balancesActions), withSuccessNotification( balancesActions, 'notifications.success.receivedBlockchainInfo',