From e2a0fddcaa8c30babd6be07a1941793a775f5e19 Mon Sep 17 00:00:00 2001 From: Aditya Radhakrishnan Date: Tue, 12 Jul 2022 10:20:35 -0700 Subject: [PATCH] fix(users): fix to not get invite token unless the invite token modal is visible (#5380) --- .../src/app/identity/user/ViewInviteTokenModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datahub-web-react/src/app/identity/user/ViewInviteTokenModal.tsx b/datahub-web-react/src/app/identity/user/ViewInviteTokenModal.tsx index a353af4677..d8d2d9ccc3 100644 --- a/datahub-web-react/src/app/identity/user/ViewInviteTokenModal.tsx +++ b/datahub-web-react/src/app/identity/user/ViewInviteTokenModal.tsx @@ -42,7 +42,7 @@ type Props = { export default function ViewInviteTokenModal({ visible, onClose }: Props) { const baseUrl = window.location.origin; - const { data: getNativeUserInviteTokenData } = useGetNativeUserInviteTokenQuery({}); + const { data: getNativeUserInviteTokenData } = useGetNativeUserInviteTokenQuery({ skip: !visible }); const [createNativeUserInviteToken, { data: createNativeUserInviteTokenData }] = useCreateNativeUserInviteTokenMutation({});