fix: only route to error when asset is bitcoin, closes #4083

This commit is contained in:
kyranjamie
2023-08-02 11:33:16 +02:00
committed by kyranjamie
parent 7fbb65a95d
commit 099f96d32b
3 changed files with 4 additions and 3 deletions

View File

@@ -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();

View File

@@ -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,
});
}

View File

@@ -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');
});
});