diff --git a/web/src/components/menu/SearchResultActions.tsx b/web/src/components/menu/SearchResultActions.tsx index 90a70ff5d9..c7af518932 100644 --- a/web/src/components/menu/SearchResultActions.tsx +++ b/web/src/components/menu/SearchResultActions.tsx @@ -130,9 +130,15 @@ export default function SearchResultActions({ }, ); } else { - toast.error(t("dialog.toast.error", { error: errorMessage }), { - position: "top-center", - }); + toast.error( + t("dialog.toast.error", { + ns: "views/replay", + error: errorMessage, + }), + { + position: "top-center", + }, + ); } }) .finally(() => { @@ -206,7 +212,7 @@ export default function SearchResultActions({ {t("itemMenu.addTrigger.label")} )} - {searchResult.has_clip && ( + {isAdmin && searchResult.has_clip && ( void; + onDebugReplayClick?: () => void; onExportClick: () => void; onShareTimestampClick: () => void; }; @@ -42,9 +42,11 @@ export default function ActionsDropdown({ {t("recording.shareTimestamp.label", { ns: "components/dialog" })} - - {t("title", { ns: "views/replay" })} - + {onDebugReplayClick && ( + + {t("title", { ns: "views/replay" })} + + )} ); diff --git a/web/src/components/overlay/MobileReviewSettingsDrawer.tsx b/web/src/components/overlay/MobileReviewSettingsDrawer.tsx index 2ad2067462..c2daf6d051 100644 --- a/web/src/components/overlay/MobileReviewSettingsDrawer.tsx +++ b/web/src/components/overlay/MobileReviewSettingsDrawer.tsx @@ -29,6 +29,7 @@ import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; import { StartExportResponse } from "@/types/export"; import { ShareTimestampContent } from "./ShareTimestampDialog"; +import { useIsAdmin } from "@/hooks/use-is-admin"; type DrawerMode = | "none" @@ -109,6 +110,7 @@ export default function MobileReviewSettingsDrawer({ "views/replay", "common", ]); + const isAdmin = useIsAdmin(); const navigate = useNavigate(); const [drawerMode, setDrawerMode] = useState("none"); const [exportTab, setExportTab] = useState("export"); @@ -388,7 +390,7 @@ export default function MobileReviewSettingsDrawer({ {t("filter")} )} - {features.includes("debug-replay") && ( + {isAdmin && features.includes("debug-replay") && (