Skip to content

Commit ae1a4ac

Browse files
committed
feat(mobile): integrate privacy mode in account balance display
- Added useSettingsStore to retrieve privacy mode state. - Updated account balance and mempool display to conditionally show masked values based on privacy mode. - Enhanced user experience by ensuring sensitive information is hidden when privacy mode is active.
1 parent 5f46f3c commit ae1a4ac

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

  • apps/mobile/app/(authenticated)/(tabs)/(signer,explorer,converter)/signer/bitcoin

apps/mobile/app/(authenticated)/(tabs)/(signer,explorer,converter)/signer/bitcoin/accountList.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { useAccountBuilderStore } from '@/store/accountBuilder'
5050
import { useAccountsStore } from '@/store/accounts'
5151
import { useBlockchainStore } from '@/store/blockchain'
5252
import { usePriceStore } from '@/store/price'
53+
import { useSettingsStore } from '@/store/settings'
5354
import { useWalletsStore } from '@/store/wallets'
5455
import { Colors } from '@/styles'
5556
import { type Network } from '@/types/settings/blockchain'
@@ -170,6 +171,7 @@ export default function AccountList() {
170171
state.fiatCurrency
171172
])
172173
)
174+
const privacyMode = useSettingsStore((state) => state.privacyMode)
173175
const [wallets, addresses] = useWalletsStore(
174176
useShallow((state) => [state.wallets, state.addresses])
175177
)
@@ -820,9 +822,11 @@ export default function AccountList() {
820822
{t('accounts.totalBalance')}
821823
</SSText>
822824
<SSText size="xxs" style={{ color: Colors.gray['200'] }}>
823-
{totalBalance.toLocaleString(undefined, {
824-
maximumFractionDigits: 0
825-
})}
825+
{privacyMode
826+
? '••••'
827+
: totalBalance.toLocaleString(undefined, {
828+
maximumFractionDigits: 0
829+
})}
826830
</SSText>
827831
</SSHStack>
828832
<View style={{ width: 12 }} />
@@ -831,9 +835,11 @@ export default function AccountList() {
831835
{t('accounts.satsInMempool').replace('\n', ' ')}
832836
</SSText>
833837
<SSText size="xxs" style={{ color: Colors.gray['200'] }}>
834-
{totalSatsInMempoll.toLocaleString(undefined, {
835-
maximumFractionDigits: 0
836-
})}
838+
{privacyMode
839+
? '••••'
840+
: totalSatsInMempoll.toLocaleString(undefined, {
841+
maximumFractionDigits: 0
842+
})}
837843
</SSText>
838844
</SSHStack>
839845
</SSHStack>

0 commit comments

Comments
 (0)