navigate immediately on 202 from debug replay menus and dialog

This commit is contained in:
Josh Hawkins 2026-05-02 23:22:57 -05:00
parent d525ed7862
commit b01d4779da
3 changed files with 3 additions and 26 deletions

View File

@ -90,10 +90,6 @@ export default function SearchResultActions({
const handleDebugReplay = useCallback( const handleDebugReplay = useCallback(
(event: SearchResult) => { (event: SearchResult) => {
setIsStarting(true); setIsStarting(true);
const toastId = toast.loading(
t("dialog.starting", { ns: "views/replay" }),
{ position: "top-center" },
);
axios axios
.post("debug_replay/start", { .post("debug_replay/start", {
@ -102,11 +98,7 @@ export default function SearchResultActions({
end_time: event.end_time, end_time: event.end_time,
}) })
.then((response) => { .then((response) => {
if (response.status === 200) { if (response.status === 202 || response.status === 200) {
toast.success(t("dialog.toast.success", { ns: "views/replay" }), {
id: toastId,
position: "top-center",
});
navigate("/replay"); navigate("/replay");
} }
}) })
@ -120,7 +112,6 @@ export default function SearchResultActions({
toast.error( toast.error(
t("dialog.toast.alreadyActive", { ns: "views/replay" }), t("dialog.toast.alreadyActive", { ns: "views/replay" }),
{ {
id: toastId,
position: "top-center", position: "top-center",
closeButton: true, closeButton: true,
dismissible: false, dismissible: false,
@ -135,7 +126,6 @@ export default function SearchResultActions({
); );
} else { } else {
toast.error(t("dialog.toast.error", { error: errorMessage }), { toast.error(t("dialog.toast.error", { error: errorMessage }), {
id: toastId,
position: "top-center", position: "top-center",
}); });
} }

View File

@ -209,10 +209,7 @@ export default function DebugReplayDialog({
end_time: range.before, end_time: range.before,
}) })
.then((response) => { .then((response) => {
if (response.status === 200) { if (response.status === 202 || response.status === 200) {
toast.success(t("dialog.toast.success"), {
position: "top-center",
});
setMode("none"); setMode("none");
setRange(undefined); setRange(undefined);
navigate("/replay"); navigate("/replay");

View File

@ -53,10 +53,6 @@ export default function EventMenu({
const handleDebugReplay = useCallback( const handleDebugReplay = useCallback(
(event: Event) => { (event: Event) => {
setIsStarting(true); setIsStarting(true);
const toastId = toast.loading(
t("dialog.starting", { ns: "views/replay" }),
{ position: "top-center" },
);
axios axios
.post("debug_replay/start", { .post("debug_replay/start", {
@ -65,11 +61,7 @@ export default function EventMenu({
end_time: event.end_time, end_time: event.end_time,
}) })
.then((response) => { .then((response) => {
if (response.status === 200) { if (response.status === 202 || response.status === 200) {
toast.success(t("dialog.toast.success", { ns: "views/replay" }), {
id: toastId,
position: "top-center",
});
navigate("/replay"); navigate("/replay");
} }
}) })
@ -83,7 +75,6 @@ export default function EventMenu({
toast.error( toast.error(
t("dialog.toast.alreadyActive", { ns: "views/replay" }), t("dialog.toast.alreadyActive", { ns: "views/replay" }),
{ {
id: toastId,
position: "top-center", position: "top-center",
closeButton: true, closeButton: true,
dismissible: false, dismissible: false,
@ -98,7 +89,6 @@ export default function EventMenu({
); );
} else { } else {
toast.error(t("dialog.toast.error", { error: errorMessage }), { toast.error(t("dialog.toast.error", { error: errorMessage }), {
id: toastId,
position: "top-center", position: "top-center",
}); });
} }