Skip to content

Commit 6b6d47f

Browse files
committed
Use mutation loading prop
1 parent 348aa6f commit 6b6d47f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

components/dashboard/src/configurations/detail/ConfigurationDeleteModal.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import type { Project } from "@gitpod/gitpod-protocol";
8-
import { FunctionComponent, useCallback, useState } from "react";
8+
import { FunctionComponent, useCallback } from "react";
99
import ConfirmationModal from "../../components/ConfirmationModal";
1010
import { useDeleteProject } from "../../data/projects/project-queries";
1111

@@ -20,13 +20,10 @@ export const RemoveConfigurationModal: FunctionComponent<RemoveConfigurationModa
2020
onClose,
2121
onRemoved,
2222
}) => {
23-
const [disabled, setDisabled] = useState(false);
2423
const useDeleteRepository = useDeleteProject();
2524

2625
const removeConfiguration = useCallback(async () => {
27-
setDisabled(true);
2826
await useDeleteRepository.mutateAsync(configuration.id);
29-
setDisabled(false);
3027
onRemoved();
3128
}, [onRemoved, configuration.id, useDeleteRepository]);
3229

@@ -39,7 +36,7 @@ export const RemoveConfigurationModal: FunctionComponent<RemoveConfigurationModa
3936
description: configuration.cloneUrl ?? "",
4037
}}
4138
buttonText="Remove Configuration"
42-
buttonDisabled={disabled}
39+
buttonDisabled={useDeleteRepository.isLoading}
4340
onClose={onClose}
4441
onConfirm={removeConfiguration}
4542
visible

0 commit comments

Comments
 (0)