From b01d4779da599990471946f1dcff2347da2d8d95 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sat, 2 May 2026 23:22:57 -0500 Subject: [PATCH] navigate immediately on 202 from debug replay menus and dialog --- web/src/components/menu/SearchResultActions.tsx | 12 +----------- web/src/components/overlay/DebugReplayDialog.tsx | 5 +---- web/src/components/timeline/EventMenu.tsx | 12 +----------- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/web/src/components/menu/SearchResultActions.tsx b/web/src/components/menu/SearchResultActions.tsx index 2c9967348..b88e69853 100644 --- a/web/src/components/menu/SearchResultActions.tsx +++ b/web/src/components/menu/SearchResultActions.tsx @@ -90,10 +90,6 @@ export default function SearchResultActions({ const handleDebugReplay = useCallback( (event: SearchResult) => { setIsStarting(true); - const toastId = toast.loading( - t("dialog.starting", { ns: "views/replay" }), - { position: "top-center" }, - ); axios .post("debug_replay/start", { @@ -102,11 +98,7 @@ export default function SearchResultActions({ end_time: event.end_time, }) .then((response) => { - if (response.status === 200) { - toast.success(t("dialog.toast.success", { ns: "views/replay" }), { - id: toastId, - position: "top-center", - }); + if (response.status === 202 || response.status === 200) { navigate("/replay"); } }) @@ -120,7 +112,6 @@ export default function SearchResultActions({ toast.error( t("dialog.toast.alreadyActive", { ns: "views/replay" }), { - id: toastId, position: "top-center", closeButton: true, dismissible: false, @@ -135,7 +126,6 @@ export default function SearchResultActions({ ); } else { toast.error(t("dialog.toast.error", { error: errorMessage }), { - id: toastId, position: "top-center", }); } diff --git a/web/src/components/overlay/DebugReplayDialog.tsx b/web/src/components/overlay/DebugReplayDialog.tsx index 2a9e09d08..2f9a7159a 100644 --- a/web/src/components/overlay/DebugReplayDialog.tsx +++ b/web/src/components/overlay/DebugReplayDialog.tsx @@ -209,10 +209,7 @@ export default function DebugReplayDialog({ end_time: range.before, }) .then((response) => { - if (response.status === 200) { - toast.success(t("dialog.toast.success"), { - position: "top-center", - }); + if (response.status === 202 || response.status === 200) { setMode("none"); setRange(undefined); navigate("/replay"); diff --git a/web/src/components/timeline/EventMenu.tsx b/web/src/components/timeline/EventMenu.tsx index 71aa12bd6..375430c2e 100644 --- a/web/src/components/timeline/EventMenu.tsx +++ b/web/src/components/timeline/EventMenu.tsx @@ -53,10 +53,6 @@ export default function EventMenu({ const handleDebugReplay = useCallback( (event: Event) => { setIsStarting(true); - const toastId = toast.loading( - t("dialog.starting", { ns: "views/replay" }), - { position: "top-center" }, - ); axios .post("debug_replay/start", { @@ -65,11 +61,7 @@ export default function EventMenu({ end_time: event.end_time, }) .then((response) => { - if (response.status === 200) { - toast.success(t("dialog.toast.success", { ns: "views/replay" }), { - id: toastId, - position: "top-center", - }); + if (response.status === 202 || response.status === 200) { navigate("/replay"); } }) @@ -83,7 +75,6 @@ export default function EventMenu({ toast.error( t("dialog.toast.alreadyActive", { ns: "views/replay" }), { - id: toastId, position: "top-center", closeButton: true, dismissible: false, @@ -98,7 +89,6 @@ export default function EventMenu({ ); } else { toast.error(t("dialog.toast.error", { error: errorMessage }), { - id: toastId, position: "top-center", }); }