diff --git a/media_commons_booking_app/src/client/admin-page/components/AdminUsers.tsx b/media_commons_booking_app/src/client/admin-page/components/AdminUsers.tsx
index 4600739b..9fe10906 100644
--- a/media_commons_booking_app/src/client/admin-page/components/AdminUsers.tsx
+++ b/media_commons_booking_app/src/client/admin-page/components/AdminUsers.tsx
@@ -3,6 +3,7 @@ import React, { useState, useEffect } from 'react';
// This is a wrapper for google.script.run that lets us use promises.
import { serverFunctions } from '../../utils/serverFunctions';
import { formatDate } from '../../utils/date';
+import { Loading } from '../../utils/Loading';
const ADMIN_USER_SHEET_NAME = 'admin_users';
@@ -50,6 +51,8 @@ export const AdminUsers = () => {
};
const addAdminUser = async () => {
+ setLoading(true);
+
if (adminEmails.includes(email)) {
alert('This user is already registered');
return;
@@ -61,8 +64,13 @@ export const AdminUsers = () => {
]);
alert('User has been registered successfully!');
+ setLoading(false);
fetchAdminUsers();
};
+ const [loading, setLoading] = useState(false);
+ if (loading) {
+ return