Skip to content

Commit

Permalink
fix: only route to error when asset is bitcoin, closes #4083
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Aug 3, 2023
1 parent 7fbb65a commit 099f96d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/app/query/common/remote-config/remote-config.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
Expand All @@ -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,
});
}
Expand Down
1 change: 1 addition & 0 deletions tests/specs/ledger/ledger.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});

0 comments on commit 099f96d

Please sign in to comment.