diff --git a/desktop/src/features/channels/ui/MembersSidebar.tsx b/desktop/src/features/channels/ui/MembersSidebar.tsx index 9a4e56b363f..bfe1b5823c0 100644 --- a/desktop/src/features/channels/ui/MembersSidebar.tsx +++ b/desktop/src/features/channels/ui/MembersSidebar.tsx @@ -283,6 +283,7 @@ export function MembersSidebar({ ? pastedProfileQuery.data?.profiles[pastedPubkey] : undefined; const pastedKeyResolved = + pastedPubkey !== null && pastedProfileQuery.isSuccess && !pastedProfileQuery.isFetching && !rosterQuery.isLoading; diff --git a/desktop/tests/e2e/channels.spec.ts b/desktop/tests/e2e/channels.spec.ts index c193b09e97e..d7ea18dab1e 100644 --- a/desktop/tests/e2e/channels.spec.ts +++ b/desktop/tests/e2e/channels.spec.ts @@ -4787,6 +4787,26 @@ test("members sidebar offers nothing for a malformed key", async ({ page }) => { await expect(page.getByText("No matching people or agents.")).toBeVisible(); }); +test("members sidebar keeps the outsider notice to pasted keys once the roster is cached", async ({ + page, +}) => { + await page.goto("/"); + await openMembersSidebar(page, "general"); + + const search = page.getByTestId("channel-management-search-users"); + const outsiderNotice = page.getByText( + "That key isn’t a member of this community yet.", + ); + await search.fill(PASTED_NPUB); + await expect(outsiderNotice).toBeVisible(); + + await search.clear(); + await search.fill("zzzz-matches-nobody"); + + await expect(page.getByText("No matching people or agents.")).toBeVisible(); + await expect(outsiderNotice).toHaveCount(0); +}); + test("members sidebar pages add-member search beyond the first 50 people", async ({ page, }) => {