Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix notify_badge.tsx toggle not working #208996

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
…-fix'
  • Loading branch information
kibanamachine committed Jan 30, 2025
commit 1d12419f8edb599cbd6ca57f00173e6e41a6543c
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,17 @@ export const RulesListNotifyBadge: React.FunctionComponent<RulesListNotifyBadgeP
const isDisabled = Boolean(disabled) || !snoozeSettings;
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
const togglePopover = useCallback(() => {
setIsPopoverOpen(prev => {
setIsPopoverOpen((prev) => {
const newState = !prev;
if (!newState) focusTrapButtonRef.current?.blur();
return newState;
});
}, []);
const openPopover = useCallback(() => setIsPopoverOpen(true), [setIsPopoverOpen]);
const closePopover = useCallback(() => {setIsPopoverOpen(false);focusTrapButtonRef.current?.blur();}, [setIsPopoverOpen]);
const closePopover = useCallback(() => {
setIsPopoverOpen(false);
focusTrapButtonRef.current?.blur();
}, [setIsPopoverOpen]);
const isSnoozedUntil = snoozeSettings?.isSnoozedUntil;
const muteAll = snoozeSettings?.muteAll ?? false;
const isSnoozedIndefinitely = muteAll;
Expand Down