diff --git a/frontend/src/app/routes/models/model-details.tsx b/frontend/src/app/routes/models/model-details.tsx index 48f22460..c98d3f5c 100644 --- a/frontend/src/app/routes/models/model-details.tsx +++ b/frontend/src/app/routes/models/model-details.tsx @@ -32,12 +32,8 @@ export const ModelDetailsPage = () => { openDialog: openModelFilesDialog, } = useDialog(); const navigate = useNavigate(); - const { data, isPending, isError, error } = useModelDetails( - id as string, - id !== undefined, - 10000, - ); - const { isAuthenticated } = useAuth(); + const { data, isPending, isError, error } = useModelDetails(id as string, id !== undefined, 10000); + const { user } = useAuth(); useEffect(() => { if (isError) { @@ -59,6 +55,7 @@ export const ModelDetailsPage = () => { if (isPending || isError) { return ; } + const isOwner = user?.osm_id === data?.user?.osm_id; return ( <> @@ -111,7 +108,6 @@ export const ModelDetailsPage = () => { size="medium" prefixIcon={StarStackIcon} onClick={openModelEnhancementDialog} - disabled={!isAuthenticated} /> {/* mobile */} @@ -127,7 +123,7 @@ export const ModelDetailsPage = () => { size="medium" prefixIcon={StarStackIcon} onClick={openModelEnhancementDialog} - disabled={!isAuthenticated} + disabled={!isOwner} /> { content: [ `${MODEL_CREATION_CONTENT.trainingSettings.form.epoch.label}: ${formData.epoch}`, `${MODEL_CREATION_CONTENT.trainingSettings.form.batchSize.label}: ${formData.batchSize}`, - formData.baseModel === BASE_MODELS.RAMP - ? `${MODEL_CREATION_CONTENT.trainingSettings.form.contactSpacing.label}: ${formData.contactSpacing}` - : "", - formData.baseModel === BASE_MODELS.RAMP - ? `${MODEL_CREATION_CONTENT.trainingSettings.form.boundaryWidth.label}: ${formData.boundaryWidth}` - : "", + formData.baseModel === BASE_MODELS.RAMP ? `${MODEL_CREATION_CONTENT.trainingSettings.form.contactSpacing.label}: ${formData.contactSpacing}` : '', + formData.baseModel === BASE_MODELS.RAMP ? `${MODEL_CREATION_CONTENT.trainingSettings.form.boundaryWidth.label}: ${formData.boundaryWidth}` : '', ], }, ]; diff --git a/frontend/src/features/model-creation/components/progress-bar.tsx b/frontend/src/features/model-creation/components/progress-bar.tsx index b2ecd89d..ee5a68f1 100644 --- a/frontend/src/features/model-creation/components/progress-bar.tsx +++ b/frontend/src/features/model-creation/components/progress-bar.tsx @@ -1,8 +1,6 @@ -import { useModelsContext } from "@/app/providers/models-provider"; import CheckIcon from "@/components/ui/icons/check-icon"; import { cn } from "@/utils"; import { memo } from "react"; -import { useNavigate } from "react-router-dom"; type ProgressBarProps = { currentPath: string; @@ -12,21 +10,14 @@ type ProgressBarProps = { const ProgressBar: React.FC = memo( ({ currentPath, currentPageIndex, pages }) => { - const navigate = useNavigate(); - const { getFullPath, isEditMode } = useModelsContext(); return (
- {pages.map((step, index) => { + {pages.map((step) => { const activeStep = currentPath.includes(step.path); - const isLastPage = index === pages.length - 1; return (