Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/stale-ways-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
---

MAD Fix Hedera add account
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { openModal } from "~/renderer/actions/modals";
import { track, trackPage } from "~/renderer/analytics/segment";
import createStore from "~/renderer/createStore";
import { State } from "~/renderer/reducers";
import { ARB_ACCOUNT, BTC_ACCOUNT } from "../../__mocks__/accounts.mock";
import { ARB_ACCOUNT, BTC_ACCOUNT, HEDERA_ACCOUNT } from "../../__mocks__/accounts.mock";
import {
arbitrumCurrency,
bitcoinCurrency,
Expand Down Expand Up @@ -357,4 +357,16 @@ describe("ModularDrawerAddAccountFlowManager", () => {
expect(screen.getByText("We couldn't add a new Hedera account")).toBeInTheDocument();
expectTrackPage(3, "cant add new account", { reason: "NO_ASSOCIATED_ACCOUNTS" });
});

it("should add a Hedera account when one is scanned", async () => {
setup(hederaCurrency);

await mockScanAccountsSubscription([HEDERA_ACCOUNT]);

expect(screen.getByText(/we found 1 account/i)).toBeInTheDocument();

await userEvent.click(screen.getByRole("button", { name: "Confirm" }));
expectTrackPage(3, "add account success");
expect(screen.getByText(/account added to your portfolio/i)).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,7 @@ export function useScanAccounts({
if (!scanning && !hasImportedAccounts) {
if (alreadyEmptyAccount && !importableAccounts.length) {
navigateToWarningScreen(WARNING_REASON.ALREADY_EMPTY_ACCOUNT, alreadyEmptyAccount);
} else if (
(!creatableAccounts.length || !importableAccounts.length) &&
CustomNoAssociatedAccounts
) {
} else if (!scannedAccounts.length && CustomNoAssociatedAccounts) {
navigateToWarningScreen(WARNING_REASON.NO_ASSOCIATED_ACCOUNTS);
}
}
Expand All @@ -214,6 +211,7 @@ export function useScanAccounts({
hasImportedAccounts,
importableAccounts.length,
navigateToWarningScreen,
scannedAccounts.length,
scanning,
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
baseCurrency,
bitcoinCurrency,
ethereumCurrency,
hederaCurrency,
scrollCurrency,
} from "./useSelectAssetFlow.mock";

Expand Down Expand Up @@ -61,6 +62,10 @@ export const SCROLL_ACCOUNT = genAccount("scroll-1", {
currency: scrollCurrency,
operationsSize: 100,
});
export const HEDERA_ACCOUNT = genAccount("hedera-1", {
currency: hederaCurrency,
operationsSize: 100,
});

export const useCountervaluesPolling = () => ({
wipe: () => {},
Expand Down
Loading