Skip to content

Commit

Permalink
Merge pull request #4703 from coralproject/fix/CORL-3203-live-updates…
Browse files Browse the repository at this point in the history
…-refresh

[CORL-3202] don't show the `Refresh comments` button when live updates are disabled
  • Loading branch information
tessalt authored Dec 3, 2024
2 parents d115303 + 896465d commit 10fb973
Show file tree
Hide file tree
Showing 4 changed files with 625 additions and 719 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ const UserBanPopoverContainer: FunctionComponent<Props> = ({
size="regular"
color="stream"
onClick={onCloseConfirm}
data-testid="UserBanPopover-close"
>
Close
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ export const AllCommentsTabContainer: FunctionComponent<Props> = ({
}, [visible, isNotFirstLoad]);

useEffect(() => {
if (visible && isNotFirstLoad) {
if (visible && isNotFirstLoad && live) {
setShowCommentRefreshButton(true);
}
}, [visible, setShowCommentRefreshButton]);
}, [visible, setShowCommentRefreshButton, live, isNotFirstLoad]);

useEffect(() => {
if (!topOfCommentsInView && allCommentsInView) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ it("spam ban user", async () => {
const communityLink = screen.getByRole("link", { name: "Community section" });
expect(communityLink).toBeInTheDocument();
expect(communityLink).toHaveAttribute("href", "/admin/community");
const closeButton = screen.getByRole("button", { name: "Close" });
const closeButton = screen.getByTestId("UserBanPopover-close");
fireEvent.click(closeButton);

// spam ban comfirmation should no longer be shown after Close button clicked
Expand Down
Loading

0 comments on commit 10fb973

Please sign in to comment.