|
|
@@ -11,7 +11,9 @@ import { ApiTokenSettings } from './ApiTokenSettings';
|
|
|
const ApiSettings = React.memo((): JSX.Element => {
|
|
|
|
|
|
const { t } = useTranslation();
|
|
|
- const { data: currentUser } = useCurrentUser();
|
|
|
+ const { data: currentUser, isLoading: isLoadingCurrentUserData } = useCurrentUser();
|
|
|
+
|
|
|
+ const shouldHideAccessTokenSettings = isLoadingCurrentUserData || !currentUser?.readOnly;
|
|
|
|
|
|
return (
|
|
|
<>
|
|
|
@@ -19,7 +21,8 @@ const ApiSettings = React.memo((): JSX.Element => {
|
|
|
<h2 className="border-bottom pb-2 my-4 fs-4">{ t('API Token Settings') }</h2>
|
|
|
<ApiTokenSettings />
|
|
|
</div>
|
|
|
- {!currentUser?.readOnly && (
|
|
|
+
|
|
|
+ {shouldHideAccessTokenSettings && (
|
|
|
<div className="mt-4">
|
|
|
<h2 className="border-bottom pb-2 my-4 fs-4">{ t('Access Token Settings') }</h2>
|
|
|
<AccessTokenSettings />
|