From 5e2f4ace63172d0227ad61f2984a8cd4a1c1249b Mon Sep 17 00:00:00 2001 From: lgalis Date: Tue, 2 Jul 2024 13:56:59 -0400 Subject: [PATCH] [AAP-26470] Add an optional disabled property to the EdaActiveUserProvider (#2627) --- frontend/eda/common/useEdaActiveUser.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/eda/common/useEdaActiveUser.tsx b/frontend/eda/common/useEdaActiveUser.tsx index 283f8362f6..f88a0eda1f 100644 --- a/frontend/eda/common/useEdaActiveUser.tsx +++ b/frontend/eda/common/useEdaActiveUser.tsx @@ -16,7 +16,15 @@ export function useEdaActiveUser() { return useContext(EdaActiveUserContext); } -export function EdaActiveUserProvider(props: { children: ReactNode }) { +export function EdaActiveUserProvider(props: { children: ReactNode; disabled?: boolean }) { + return props?.disabled ? ( + {props.children} + ) : ( + {props?.children} + ); +} + +export function EdaActiveUserProviderInternal(props: { children: ReactNode }) { const response = useSWR(edaAPI`/users/me/`, requestGet, { dedupingInterval: 0, refreshInterval: 10 * 1000,