mirror of
https://github.com/langgenius/dify.git
synced 2026-08-28 19:16:51 +08:00
feat: Add loading to delete confirmation dialog
This commit is contained in:
parent
7d4f8e0082
commit
837990cb80
@ -39,6 +39,10 @@ const Action: FC<Props> = ({
|
||||
setFalse: hidePluginInfo,
|
||||
}] = useBoolean(false)
|
||||
const mutateInstalledPluginList = usePluginPageContext(v => v.mutateInstalledPluginList)
|
||||
const [deleting, {
|
||||
setTrue: showDeleting,
|
||||
setFalse: hideDeleting,
|
||||
}] = useBoolean(false)
|
||||
|
||||
const handleFetchNewVersion = () => { }
|
||||
|
||||
@ -48,7 +52,9 @@ const Action: FC<Props> = ({
|
||||
}] = useBoolean(false)
|
||||
|
||||
const handleDelete = useCallback(async () => {
|
||||
showDeleting()
|
||||
const res = await uninstallPlugin(pluginId)
|
||||
hideDeleting()
|
||||
if (res.success) {
|
||||
hideDeleteConfirm()
|
||||
mutateInstalledPluginList()
|
||||
@ -99,10 +105,8 @@ const Action: FC<Props> = ({
|
||||
onHide={hidePluginInfo}
|
||||
/>
|
||||
)}
|
||||
{
|
||||
isShowDeleteConfirm && (
|
||||
<Confirm
|
||||
isShow
|
||||
isShow={isShowDeleteConfirm}
|
||||
title={t(`${i18nPrefix}.delete`)}
|
||||
content={
|
||||
<div>
|
||||
@ -113,9 +117,9 @@ const Action: FC<Props> = ({
|
||||
}
|
||||
onCancel={hideDeleteConfirm}
|
||||
onConfirm={handleDelete}
|
||||
isLoading={deleting}
|
||||
isDisabled={deleting}
|
||||
/>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user