diff --git a/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx b/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx index 377a1d899e4..fc38326398e 100644 --- a/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx +++ b/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx @@ -37,6 +37,7 @@ import { KeyBindingAction } from "../../../../accessibility/KeyboardShortcuts"; import { ReleaseAnnouncement } from "../../../structures/ReleaseAnnouncement"; import { useIsReleaseAnnouncementOpen } from "../../../../hooks/useIsReleaseAnnouncementOpen"; import { useSettingValue } from "../../../../hooks/useSettings"; +import { ReleaseAnnouncementStore } from "../../../../stores/ReleaseAnnouncementStore"; interface ThreadsActivityCentreProps { /** @@ -85,6 +86,11 @@ export function ThreadsActivityCentre({ displayButtonLabel }: ThreadsActivityCen disableTooltip={true} displayLabel={displayButtonLabel} notificationLevel={roomsAndNotifications.greatestNotificationLevel} + onClick={async () => { + // Open the TAC after the release announcement closing + setOpen(true); + await ReleaseAnnouncementStore.instance.nextReleaseAnnouncement(); + }} /> ) : ( diff --git a/test/components/views/spaces/ThreadsActivityCentre-test.tsx b/test/components/views/spaces/ThreadsActivityCentre-test.tsx index b6ed5792bd8..bf7defc83d5 100644 --- a/test/components/views/spaces/ThreadsActivityCentre-test.tsx +++ b/test/components/views/spaces/ThreadsActivityCentre-test.tsx @@ -129,6 +129,16 @@ describe("ThreadsActivityCentre", () => { expect(screen.queryByRole("tooltip")).toBeNull(); }); + it("should close the release announcement when the TAC button is clicked", async () => { + // Enable release announcement + await SettingsStore.setValue("feature_release_announcement", null, SettingLevel.DEVICE, true); + + renderTAC(); + await userEvent.click(getTACButton()); + expect(getTACMenu()).toBeInTheDocument(); + expect(document.body).toMatchSnapshot(); + }); + it("should render the threads activity centre button and the display label", async () => { renderTAC({ displayButtonLabel: true }); expect(getTACButton()).toBeInTheDocument(); diff --git a/test/components/views/spaces/__snapshots__/ThreadsActivityCentre-test.tsx.snap b/test/components/views/spaces/__snapshots__/ThreadsActivityCentre-test.tsx.snap index 028011341e3..56bc5451f3e 100644 --- a/test/components/views/spaces/__snapshots__/ThreadsActivityCentre-test.tsx.snap +++ b/test/components/views/spaces/__snapshots__/ThreadsActivityCentre-test.tsx.snap @@ -2,7 +2,7 @@ exports[`ThreadsActivityCentre renders notifications matching the snapshot 1`] = `
`; +exports[`ThreadsActivityCentre should close the release announcement when the TAC button is clicked 1`] = ` + + + +