Skip to content

Commit e7e5249

Browse files
committed
fix: require shareable hackathon team forms
1 parent d14dde3 commit e7e5249

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

pages/hackathon/[id]/team/[tid].tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,12 @@ const ProjectPage: FC<ProjectPageProps> = observer(
161161
.filter(({ shared_url }) => Boolean(shared_url)),
162162
[forms],
163163
);
164+
const hasShareUrl = ({ shared_url }: TableFormView) => Boolean(shared_url);
164165
const primaryForm =
165-
(forms?.Person || []).filter(isPublicForm)[0] ||
166-
(forms?.Project || []).filter(isPublicForm)[0] ||
166+
(forms?.Person || []).filter(isPublicForm).find(hasShareUrl) ||
167+
(forms?.Project || []).filter(isPublicForm).find(hasShareUrl) ||
167168
publicForms[0];
168-
const scoreForm = (forms?.Evaluation || []).find(isPublicForm);
169+
const scoreForm = (forms?.Evaluation || []).filter(isPublicForm).find(hasShareUrl);
169170
const currentRoute = [
170171
{ title: activityName as string, href: ActivityModel.getLink(activity) },
171172
{ title: displayTitle },

0 commit comments

Comments
 (0)