mirror of
https://github.com/block/buzz.git
synced 2026-10-31 06:21:34 +00:00
fix(desktop): restore default community join option (#1969)
Signed-off-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
@@ -64,6 +64,13 @@ export function WelcomeSetup({
|
||||
setPage(nextPage);
|
||||
}, []);
|
||||
|
||||
const handleDefaultCommunity = React.useCallback(() => {
|
||||
communityOnboarding.start({
|
||||
source: "first-community",
|
||||
relayUrl: defaultRelayUrl,
|
||||
});
|
||||
}, [communityOnboarding, defaultRelayUrl]);
|
||||
|
||||
const handleInviteRedeem = React.useCallback(
|
||||
(relayWsUrl: string, code: string) => {
|
||||
communityOnboarding.start({
|
||||
@@ -107,6 +114,15 @@ export function WelcomeSetup({
|
||||
Choose how you want to get started.
|
||||
</p>
|
||||
<div className="mt-8 flex w-full flex-col gap-3">
|
||||
{isLocalDevRelayUrl(defaultRelayUrl) ? null : (
|
||||
<Button
|
||||
className="h-10 w-full"
|
||||
onClick={handleDefaultCommunity}
|
||||
type="button"
|
||||
>
|
||||
Join default community
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
className="h-10 w-full"
|
||||
onClick={() => showPage("join")}
|
||||
|
||||
@@ -580,6 +580,9 @@ test("first-community choices expose npub and invite input", async ({
|
||||
});
|
||||
await page.goto("/");
|
||||
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Join default community" }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Join a community" }),
|
||||
).toBeVisible();
|
||||
@@ -620,6 +623,31 @@ test("first-community choices expose npub and invite input", async ({
|
||||
await expect(page.getByTestId("invite-redeem-input")).toBeVisible();
|
||||
});
|
||||
|
||||
test("first-community hides the default option for localhost", async ({
|
||||
page,
|
||||
}) => {
|
||||
await seedActiveIdentity(page, BLANK_TYLER_IDENTITY);
|
||||
await page.addInitScript((pubkey) => {
|
||||
window.localStorage.setItem(
|
||||
`buzz-machine-onboarding-complete.v2:${pubkey}`,
|
||||
"true",
|
||||
);
|
||||
}, BLANK_TYLER_IDENTITY.pubkey);
|
||||
await installMockBridge(page, undefined, {
|
||||
relayWsUrl: "ws://localhost:3000",
|
||||
skipOnboardingSeed: true,
|
||||
skipCommunitySeed: true,
|
||||
});
|
||||
await page.goto("/");
|
||||
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Join default community" }),
|
||||
).toHaveCount(0);
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Join a community" }),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test("identity fallback text does not count as a real onboarding name", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
Reference in New Issue
Block a user