From 18007a474b156cb15fe98316003a30de1e2a6469 Mon Sep 17 00:00:00 2001 From: Howard Halim Date: Sun, 23 Feb 2025 19:11:07 -0500 Subject: [PATCH 1/2] Add TopsOJ --- app/invite/[code]/actions.ts | 5 +++++ components/sidebar.tsx | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/app/invite/[code]/actions.ts b/app/invite/[code]/actions.ts index 06e0c77..5967b96 100644 --- a/app/invite/[code]/actions.ts +++ b/app/invite/[code]/actions.ts @@ -58,6 +58,11 @@ export async function acceptInvite( userId, collectionId: invite.collectionId, accessLevel: invite.accessLevel, + // TODO: find a better way to enforce a specific testsolver type + ...(invite.collection.cid === "topsoj" && { + testsolverType: "Serious", + seriousTestsolverStartedAt: invite.collection.createdAt, + }), }, }); diff --git a/components/sidebar.tsx b/components/sidebar.tsx index 284b899..36c747b 100644 --- a/components/sidebar.tsx +++ b/components/sidebar.tsx @@ -25,6 +25,11 @@ export default function Sidebar({ children }: { children: React.ReactNode }) { label: "OTIS Mock AIME", active: pathname !== null && pathname.startsWith("/c/otis-mock-aime"), }, + { + href: "/c/topsoj", + label: "TopSOJ", + active: pathname !== null && pathname.startsWith("/c/topsoj"), + }, ]; return ( From 36ee995f43357e1f4fa1b20379e7afe8562c252e Mon Sep 17 00:00:00 2001 From: Howard Halim Date: Sun, 23 Feb 2025 19:11:57 -0500 Subject: [PATCH 2/2] Fix typo --- components/sidebar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/sidebar.tsx b/components/sidebar.tsx index 36c747b..8196a87 100644 --- a/components/sidebar.tsx +++ b/components/sidebar.tsx @@ -27,7 +27,7 @@ export default function Sidebar({ children }: { children: React.ReactNode }) { }, { href: "/c/topsoj", - label: "TopSOJ", + label: "TopsOJ", active: pathname !== null && pathname.startsWith("/c/topsoj"), }, ];