From 08489334dd1075607df3911aadffd6855c5831e9 Mon Sep 17 00:00:00 2001 From: Charles Zhao Date: Mon, 11 Dec 2023 09:48:34 +0800 Subject: [PATCH] fix(console): user identities table should not always be loading when no data (#5086) --- .../UserSettings/components/UserSocialIdentities/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/console/src/pages/UserDetails/UserSettings/components/UserSocialIdentities/index.tsx b/packages/console/src/pages/UserDetails/UserSettings/components/UserSocialIdentities/index.tsx index 4ba9069b9..a7bd5cf46 100644 --- a/packages/console/src/pages/UserDetails/UserSettings/components/UserSocialIdentities/index.tsx +++ b/packages/console/src/pages/UserDetails/UserSettings/components/UserSocialIdentities/index.tsx @@ -38,7 +38,9 @@ function UserSocialIdentities({ userId, identities, onDelete }: Props) { keyPrefix: 'admin_console', }); - const { data, error, mutate } = useSWR('api/connectors'); + const { data, error, isLoading, mutate } = useSWR( + 'api/connectors' + ); const [deletingConnector, setDeletingConnector] = useState(); const [isSubmitting, setIsSubmitting] = useState(false); @@ -51,8 +53,6 @@ function UserSocialIdentities({ userId, identities, onDelete }: Props) { return getConnectorGroups(data); }, [data]); - const isLoading = !connectorGroups && !error; - const handleDelete = async (target: string) => { if (isSubmitting) { return;