From a4e2be9b88810e0855049d7d9d81ede988347151 Mon Sep 17 00:00:00 2001 From: Weves Date: Sat, 26 Oct 2024 12:40:53 -0700 Subject: [PATCH] Add more logging --- web/src/app/admin/connectors/[connector]/Sidebar.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/web/src/app/admin/connectors/[connector]/Sidebar.tsx b/web/src/app/admin/connectors/[connector]/Sidebar.tsx index ebf09f14f04..56682f9e00a 100644 --- a/web/src/app/admin/connectors/[connector]/Sidebar.tsx +++ b/web/src/app/admin/connectors/[connector]/Sidebar.tsx @@ -13,15 +13,21 @@ import { UserRole } from "@/lib/types"; function BackButton({ isAdmin, isCurator, + user, }: { isAdmin: boolean; isCurator: boolean; + user: User | null; }) { const buttonText = isAdmin ? "Admin Page" : "Curator Page"; if (!isAdmin && !isCurator) { console.error( - "User is neither admin nor curator, defaulting to curator view" + `User is neither admin nor curator, defaulting to curator view. Found user:\n ${JSON.stringify( + user, + null, + 2 + )}` ); } @@ -42,7 +48,7 @@ export default function Sidebar() { const { formStep, setFormStep, connector, allowAdvanced, allowCreate } = useFormContext(); const combinedSettings = useContext(SettingsContext); - const { isCurator, isAdmin } = useUser(); + const { isCurator, isAdmin, user } = useUser(); if (!combinedSettings) { return null; } @@ -84,7 +90,7 @@ export default function Sidebar() { - +