diff --git a/web/src/components/menu/SearchResultActions.tsx b/web/src/components/menu/SearchResultActions.tsx index aa2562b42..2c9967348 100644 --- a/web/src/components/menu/SearchResultActions.tsx +++ b/web/src/components/menu/SearchResultActions.tsx @@ -90,6 +90,10 @@ 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", { @@ -100,6 +104,7 @@ export default function SearchResultActions({ .then((response) => { if (response.status === 200) { toast.success(t("dialog.toast.success", { ns: "views/replay" }), { + id: toastId, position: "top-center", }); navigate("/replay"); @@ -115,6 +120,7 @@ export default function SearchResultActions({ toast.error( t("dialog.toast.alreadyActive", { ns: "views/replay" }), { + id: toastId, position: "top-center", closeButton: true, dismissible: false, @@ -129,6 +135,7 @@ export default function SearchResultActions({ ); } else { toast.error(t("dialog.toast.error", { error: errorMessage }), { + id: toastId, position: "top-center", }); } diff --git a/web/src/components/timeline/EventMenu.tsx b/web/src/components/timeline/EventMenu.tsx index b12440899..71aa12bd6 100644 --- a/web/src/components/timeline/EventMenu.tsx +++ b/web/src/components/timeline/EventMenu.tsx @@ -53,6 +53,10 @@ 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", { @@ -63,6 +67,7 @@ export default function EventMenu({ .then((response) => { if (response.status === 200) { toast.success(t("dialog.toast.success", { ns: "views/replay" }), { + id: toastId, position: "top-center", }); navigate("/replay"); @@ -78,6 +83,7 @@ export default function EventMenu({ toast.error( t("dialog.toast.alreadyActive", { ns: "views/replay" }), { + id: toastId, position: "top-center", closeButton: true, dismissible: false, @@ -92,6 +98,7 @@ export default function EventMenu({ ); } else { toast.error(t("dialog.toast.error", { error: errorMessage }), { + id: toastId, position: "top-center", }); }