diff --git a/src/pages/user_profile/RequestRole.js b/src/pages/user_profile/RequestRole.js
index 1c084adfd..80c5e62c4 100644
--- a/src/pages/user_profile/RequestRole.js
+++ b/src/pages/user_profile/RequestRole.js
@@ -31,6 +31,7 @@ export default function RequestRole(props) {
}
];
+ const [hasSupportRequests, setHasSupportRequests] = useState(false);
const [supportRequests, setSupportRequests] = useState({
checkRegisterDataset: false,
checkRequestDataAccess: false,
@@ -47,6 +48,8 @@ export default function RequestRole(props) {
const handleSupportRequestsChange = ({ key, value }) => {
let newSupportRequests = Object.assign({}, supportRequests, { [key]: value });
setSupportRequests(newSupportRequests);
+ const hasAnyRequests = possibleSupportRequests.some(request => newSupportRequests[request.key]);
+ setHasSupportRequests(hasAnyRequests);
};
const submitForm = async (event) => {
@@ -160,20 +163,19 @@ export default function RequestRole(props) {
;