Skip to content

Commit

Permalink
fix(spu-ui): cast session user to Session type for proposal retrieval…
Browse files Browse the repository at this point in the history
… in StepByStepForm
  • Loading branch information
matyson committed Jan 14, 2025
1 parent 58a2f4d commit 3ee5462
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/spu-ui/src/app/_components/queue/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { MoveRightIcon, UploadIcon } from "lucide-react";
import { useForm } from "react-hook-form";
import { z } from "zod";
import type { Session } from "@sophys-web/auth";
import { api } from "@sophys-web/api-client/react";
import { Button } from "@sophys-web/ui/button";
import { Checkbox } from "@sophys-web/ui/checkbox";
Expand Down Expand Up @@ -161,7 +162,8 @@ function StepByStepForm({ onSubmitSuccess }: { onSubmitSuccess?: () => void }) {

const getProposal = useCallback(() => {
if (!proposal && session) {
return session.user.proposal;
const user = session.user as unknown as Session["user"];
return user.proposal;
}
return proposal;
}, [proposal, session]);
Expand Down

0 comments on commit 3ee5462

Please sign in to comment.