1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-19 00:15:43 +01:00

fix: disable the create button when api call is made (#7063)

Prevends duplicate calls to api

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
andreas-unleash 2024-05-16 10:52:12 +03:00 committed by GitHub
parent 28ca626bac
commit 9fc01233c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,7 +39,7 @@ export const CreateProjectDialogue = ({
open,
onClose,
}: ICreateProjectDialogueProps) => {
const { createProject } = useProjectApi();
const { createProject, loading } = useProjectApi();
const { refetchUser } = useAuthUser();
const { uiConfig } = useUiConfig();
const { setToastData, setToastApiError } = useToast();
@ -153,6 +153,7 @@ export const CreateProjectDialogue = ({
<CreateButton
name='project'
permission={CREATE_PROJECT}
disabled={loading}
data-testid={CREATE_PROJECT_BTN}
/>
</NewProjectForm>