diff --git a/frontend/src/lib/pages/Portfolio.svelte b/frontend/src/lib/pages/Portfolio.svelte index a0ec4e498e..02f5eea2a1 100644 --- a/frontend/src/lib/pages/Portfolio.svelte +++ b/frontend/src/lib/pages/Portfolio.svelte @@ -90,7 +90,7 @@ // This helps guide users to stake their tokens when possible let hasNoStakedTokensCardAPrimaryAction: boolean; $: hasNoStakedTokensCardAPrimaryAction = - stakedTokensCard === "empty" && heldTokensCard !== "empty"; + stakedTokensCard === "empty" && heldTokensCard === "full"; // Global loading state that tracks if either held or staked tokens are loading // TotalAssetsCard will show this if either held or staked are loading diff --git a/frontend/src/tests/lib/pages/Portfolio.spec.ts b/frontend/src/tests/lib/pages/Portfolio.spec.ts index 78518dc39f..c95a4276d2 100644 --- a/frontend/src/tests/lib/pages/Portfolio.spec.ts +++ b/frontend/src/tests/lib/pages/Portfolio.spec.ts @@ -467,6 +467,20 @@ describe("Portfolio page", () => { "$0.00" ); }); + + it("should not display a primary action when the staked tokens card loads before the held tokens card", async () => { + const loadingToken = createUserTokenLoading({}); + + const po = renderPage({ + userTokens: [loadingToken], + tableProjects: [], + }); + + expect(await po.getNoStakedTokensCarPo().isPresent()).toEqual(true); + expect(await po.getNoStakedTokensCarPo().hasPrimaryAction()).toEqual( + false + ); + }); }); describe("TotalAssetsCard", () => {