diff --git a/src/frontend/src/pages/Index/Settings/AccountSettings/SecurityContent.tsx b/src/frontend/src/pages/Index/Settings/AccountSettings/SecurityContent.tsx index 13719bfc60..a16375f15c 100644 --- a/src/frontend/src/pages/Index/Settings/AccountSettings/SecurityContent.tsx +++ b/src/frontend/src/pages/Index/Settings/AccountSettings/SecurityContent.tsx @@ -75,6 +75,9 @@ function EmailSection() { queryFn: () => authApi(apiUrl(ApiEndpoints.auth_email)).then((res) => res.data.data) }); + const emailAvailable = useMemo(() => { + return data == undefined || data.length == 0; + }, [data]); function runServerAction( action: 'post' | 'put' | 'delete' = 'post', @@ -96,7 +99,7 @@ function EmailSection() { return ( - {data.length == 0 ? ( + {emailAvailable ? ( } title={t`Not configured`} @@ -161,13 +164,20 @@ function EmailSection() { onClick={() => runServerAction('post', { email: value, primary: true }) } + disabled={emailAvailable} > Make Primary - -