Skip to content

Commit

Permalink
ref(browserHistory): Remove from snoozeAlert (#82598)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser authored Jan 2, 2025
1 parent 5fe0bc2 commit 5af14c9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions static/app/components/alerts/snoozeAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {DropdownMenu} from 'sentry/components/dropdownMenu';
import {IconChevron, IconMute, IconSound} from 'sentry/icons';
import {t} from 'sentry/locale';
import {RuleActionsCategories} from 'sentry/types/alerts';
import {browserHistory} from 'sentry/utils/browserHistory';
import useApi from 'sentry/utils/useApi';
import {useLocation} from 'sentry/utils/useLocation';
import {useNavigate} from 'sentry/utils/useNavigate';
import useOrganization from 'sentry/utils/useOrganization';

type Props = {
Expand Down Expand Up @@ -42,6 +42,7 @@ function SnoozeAlert({
const organization = useOrganization();
const api = useApi();
const location = useLocation();
const navigate = useNavigate();

const [disabled, setDisabled] = useState(false);

Expand All @@ -62,10 +63,13 @@ function SnoozeAlert({
);

if (autoMute) {
browserHistory.replace({
pathname: location.pathname,
query: {...location.query, mute: undefined},
});
navigate(
{
pathname: location.pathname,
query: {...location.query, mute: undefined},
},
{replace: true}
);
}

setDisabled(false);
Expand All @@ -87,6 +91,7 @@ function SnoozeAlert({
},
[
api,
navigate,
isSnoozed,
location.pathname,
location.query,
Expand Down

0 comments on commit 5af14c9

Please sign in to comment.