mirror of
https://github.com/zhigang1992/wallet.git
synced 2026-01-12 22:53:27 +08:00
fix: only route to error when asset is bitcoin, closes #4083
This commit is contained in:
@@ -23,7 +23,7 @@ export function CryptoAssetListItem(props: CryptoAssetListItemProps) {
|
||||
const isBitcoinSendEnabled = useConfigBitcoinSendEnabled();
|
||||
|
||||
function navigateToSendForm({ isFtToken = false }: { isFtToken: boolean }) {
|
||||
if (!isBitcoinSendEnabled) {
|
||||
if (asset.symbol === 'BTC' && !isBitcoinSendEnabled) {
|
||||
return navigate(RouteUrls.SendBtcDisabled);
|
||||
}
|
||||
const symbol = asset.symbol === '' ? asset.contractAssetName : asset.symbol.toLowerCase();
|
||||
|
||||
@@ -115,7 +115,7 @@ export function useConfigBitcoinEnabled() {
|
||||
const config = useRemoteConfig();
|
||||
const hasBitcoinAccount = useHasCurrentBitcoinAccount();
|
||||
return whenWallet({
|
||||
ledger: config?.bitcoinEnabled && LEDGER_BITCOIN_ENABLED && hasBitcoinAccount,
|
||||
ledger: (config?.bitcoinEnabled ?? true) && LEDGER_BITCOIN_ENABLED && hasBitcoinAccount,
|
||||
software: config?.bitcoinEnabled ?? true,
|
||||
});
|
||||
}
|
||||
@@ -125,7 +125,7 @@ export function useConfigBitcoinSendEnabled() {
|
||||
const config = useRemoteConfig();
|
||||
const hasBitcoinAccount = useHasCurrentBitcoinAccount();
|
||||
return whenWallet({
|
||||
ledger: config?.bitcoinEnabled && hasBitcoinAccount,
|
||||
ledger: config?.bitcoinSendEnabled && hasBitcoinAccount,
|
||||
software: config?.bitcoinSendEnabled ?? true,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -19,5 +19,6 @@ test.describe('App with Ledger', () => {
|
||||
const noActivityText = homePage.page.getByText('No activity yet');
|
||||
// Account has activity to make sure we don't see label
|
||||
await test.expect(noActivityText).not.toBeVisible();
|
||||
test.expect(homePage.page.url()).toContain('/activity');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user