Skip to content

Commit

Permalink
fixed hiding balance
Browse files Browse the repository at this point in the history
  • Loading branch information
Nebyt committed Dec 25, 2024
1 parent dfa6aa2 commit 1dfb24a
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> = async () => {
await this.props.stores.profile.updateHideBalance();
};
Expand Down Expand Up @@ -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) {
Expand All @@ -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)}
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 1dfb24a

Please sign in to comment.