diff --git a/src/atlas_frontend/src/components/Task/index.tsx b/src/atlas_frontend/src/components/Task/index.tsx index 690b43c..b369907 100644 --- a/src/atlas_frontend/src/components/Task/index.tsx +++ b/src/atlas_frontend/src/components/Task/index.tsx @@ -157,11 +157,13 @@ const Task = () => { ? getUsersSubmissions(currentTask.tasks) : new UserSubmissions({}); - if (!user?.principal) return <>; - const isAccepted = usersSubmissions.isAccepted(user.principal.toText()); - const userAlreadyRewarded = currentTask.rewarded - .map((p) => p.toText()) - .includes(user.principal.toText()); + const userPrincipal = user?.principal?.toText() ?? null; + const isAccepted = userPrincipal + ? usersSubmissions.isAccepted(userPrincipal) + : false; + const userAlreadyRewarded = userPrincipal + ? currentTask.rewarded.map((p) => p.toText()).includes(userPrincipal) + : false; const withdraw = async () => { if (!authAtlasSpace) { diff --git a/src/atlas_frontend/src/components/Task/tasks/GenericTask.tsx b/src/atlas_frontend/src/components/Task/tasks/GenericTask.tsx index 012bb0c..bdfeb44 100644 --- a/src/atlas_frontend/src/components/Task/tasks/GenericTask.tsx +++ b/src/atlas_frontend/src/components/Task/tasks/GenericTask.tsx @@ -361,7 +361,12 @@ const listForm = useForm({ )} {!user && (
- +
)} {user && !isUserAdmin && submissionData && (