Skip to content

Commit 7831ac1

Browse files
klopez4212Terp
andcommitted
Hide Solo Huddle menu actions during active calls
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Signed-off-by: klopez4212 <[email protected]>
1 parent 72ae507 commit 7831ac1

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

‎src/bundled/huddles/HuddleLauncher.test.tsx‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,29 @@ it("moves idle Solo huddles to the menu while preserving Team's header action",
9191
screen.getByRole("button", { name: "Cancel Huddle connection" }),
9292
);
9393
expect(leave).toHaveBeenCalledOnce();
94+
for (const phase of ["connecting", "connected", "leaving"] as const) {
95+
vi.mocked(huddles.snapshot).mockReturnValue({
96+
...connecting,
97+
phase,
98+
destination: { ...context, channelId: "other-chat" },
99+
});
100+
view.rerender(
101+
<>
102+
<HuddleLauncher {...props} />
103+
<MenuRoot open>
104+
<MenuPopup>
105+
<SoloHuddleMenu {...props} session={session} channelId="chat" />
106+
</MenuPopup>
107+
</MenuRoot>
108+
</>,
109+
);
110+
const label =
111+
phase === "connecting"
112+
? "Cancel Huddle connection"
113+
: "Show active Huddle";
114+
expect(screen.getByRole("button", { name: label })).toBeVisible();
115+
expect(screen.queryByRole("menuitem", { name: label })).toBeNull();
116+
}
94117
vi.mocked(huddles.snapshot).mockRestore();
95118
channel.channelType = "stream";
96119
view.rerender(<HuddleLauncher {...props} />);

‎src/bundled/huddles/HuddleLauncher.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export function HuddleLauncher(props: Props) {
105105
call.destination.viewer === context.viewer &&
106106
call.destination.channelId === context.channelId;
107107
if (parent?.archived) return null;
108-
if (props.menu && here) return null;
108+
if (props.menu && active) return null;
109109
if (here && call.id)
110110
return <ActiveHuddle key={call.id} {...props} callId={call.id} />;
111111
const joinable =

0 commit comments

Comments
 (0)