add debug replay loading toast for explore actions

This commit is contained in:
Josh Hawkins 2026-05-02 08:41:34 -05:00
parent 28722c7d70
commit 9b1931d588
2 changed files with 14 additions and 0 deletions

View File

@ -90,6 +90,10 @@ 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", {
@ -100,6 +104,7 @@ export default function SearchResultActions({
.then((response) => { .then((response) => {
if (response.status === 200) { if (response.status === 200) {
toast.success(t("dialog.toast.success", { ns: "views/replay" }), { toast.success(t("dialog.toast.success", { ns: "views/replay" }), {
id: toastId,
position: "top-center", position: "top-center",
}); });
navigate("/replay"); navigate("/replay");
@ -115,6 +120,7 @@ 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,
@ -129,6 +135,7 @@ 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

@ -53,6 +53,10 @@ 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", {
@ -63,6 +67,7 @@ export default function EventMenu({
.then((response) => { .then((response) => {
if (response.status === 200) { if (response.status === 200) {
toast.success(t("dialog.toast.success", { ns: "views/replay" }), { toast.success(t("dialog.toast.success", { ns: "views/replay" }), {
id: toastId,
position: "top-center", position: "top-center",
}); });
navigate("/replay"); navigate("/replay");
@ -78,6 +83,7 @@ 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,
@ -92,6 +98,7 @@ 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",
}); });
} }