From 1dfb24a0be0102e607d5946aec786c00a46edfcd Mon Sep 17 00:00:00 2001 From: Denis Nebytov Date: Wed, 25 Dec 2024 18:25:19 +0300 Subject: [PATCH 1/3] fixed hiding balance --- .../app/containers/NavBarContainerRevamp.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js b/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js index 7a17236689..49c8cd1f76 100644 --- a/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js +++ b/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js @@ -37,6 +37,10 @@ export default class NavBarContainerRevamp extends Component<{| ...StoresProps, menu: undefined, }; + isBalanceHidden: void => boolean = () => { + return this.props.stores.profile.shouldHideBalance; + }; + updateHideBalance: void => Promise = async () => { await this.props.stores.profile.updateHideBalance(); }; @@ -72,6 +76,7 @@ export default class NavBarContainerRevamp extends Component<{| ...StoresProps, const { stores, pageBanner, isErrorPage } = this.props; const { profile, wallets } = stores; const { selected, selectedWalletName } = wallets; + const shouldHideBalance = this.isBalanceHidden(); const DropdownHead = () => { if (!selected || !selectedWalletName) { @@ -86,7 +91,7 @@ export default class NavBarContainerRevamp extends Component<{| ...StoresProps, plate={plate} name={selectedWalletName} onUpdateHideBalance={this.updateHideBalance} - shouldHideBalance={profile.shouldHideBalance} + shouldHideBalance={shouldHideBalance} rewards={rewards} walletAmount={selected.balance} getTokenInfo={genLookupOrFail(this.props.stores.tokenInfoStore.tokenInfo)} @@ -156,7 +161,7 @@ export default class NavBarContainerRevamp extends Component<{| ...StoresProps, this.checkAndResetGovRoutes(); this.props.stores.uiDialogs.closeActiveDialog(); }} - shouldHideBalance={stores.profile.shouldHideBalance} + shouldHideBalance={this.isBalanceHidden()} onUpdateHideBalance={this.updateHideBalance} getTokenInfo={getTokenInfo} walletAmount={selected?.balance} From 5227b99b96a732e6316ff41c36852e19a80c7449 Mon Sep 17 00:00:00 2001 From: Denis Nebytov Date: Wed, 25 Dec 2024 18:34:48 +0300 Subject: [PATCH 2/3] one more update --- .../yoroi-extension/app/containers/NavBarContainerRevamp.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js b/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js index 49c8cd1f76..ee420383b0 100644 --- a/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js +++ b/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js @@ -128,6 +128,7 @@ export default class NavBarContainerRevamp extends Component<{| ...StoresProps, const { stores } = this.props; const { selected, wallets } = stores.wallets; const getTokenInfo = genLookupOrFail(stores.tokenInfoStore.tokenInfo); + const shouldHideBalance = this.isBalanceHidden(); if (stores.uiDialogs.isOpen(WalletListDialog)) { const cardanoWallets = []; @@ -161,7 +162,7 @@ export default class NavBarContainerRevamp extends Component<{| ...StoresProps, this.checkAndResetGovRoutes(); this.props.stores.uiDialogs.closeActiveDialog(); }} - shouldHideBalance={this.isBalanceHidden()} + shouldHideBalance={shouldHideBalance} onUpdateHideBalance={this.updateHideBalance} getTokenInfo={getTokenInfo} walletAmount={selected?.balance} From c5f2c2aecf43fbcba529998bf43c25efd602c1c1 Mon Sep 17 00:00:00 2001 From: Denis Nebytov Date: Wed, 25 Dec 2024 18:57:57 +0300 Subject: [PATCH 3/3] simplified --- .../app/containers/NavBarContainerRevamp.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js b/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js index ee420383b0..1620e603bc 100644 --- a/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js +++ b/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js @@ -37,10 +37,6 @@ export default class NavBarContainerRevamp extends Component<{| ...StoresProps, menu: undefined, }; - isBalanceHidden: void => boolean = () => { - return this.props.stores.profile.shouldHideBalance; - }; - updateHideBalance: void => Promise = async () => { await this.props.stores.profile.updateHideBalance(); }; @@ -76,7 +72,7 @@ export default class NavBarContainerRevamp extends Component<{| ...StoresProps, const { stores, pageBanner, isErrorPage } = this.props; const { profile, wallets } = stores; const { selected, selectedWalletName } = wallets; - const shouldHideBalance = this.isBalanceHidden(); + const shouldHideBalance = profile.shouldHideBalance; const DropdownHead = () => { if (!selected || !selectedWalletName) { @@ -128,7 +124,7 @@ export default class NavBarContainerRevamp extends Component<{| ...StoresProps, const { stores } = this.props; const { selected, wallets } = stores.wallets; const getTokenInfo = genLookupOrFail(stores.tokenInfoStore.tokenInfo); - const shouldHideBalance = this.isBalanceHidden(); + const shouldHideBalance = stores.profile.shouldHideBalance; if (stores.uiDialogs.isOpen(WalletListDialog)) { const cardanoWallets = [];