diff --git a/src/main/webui/src/app/components/content/addons/Cache.jsx b/src/main/webui/src/app/components/content/addons/Cache.jsx index 47345d5..89efbae 100644 --- a/src/main/webui/src/app/components/content/addons/Cache.jsx +++ b/src/main/webui/src/app/components/content/addons/Cache.jsx @@ -16,6 +16,7 @@ import React, {useState} from 'react'; import {useForm} from 'react-hook-form'; +import {ConfirmDialog} from '../common/PopupDialogs.jsx'; import {IndyRest} from '#utils/RestClient.js'; @@ -37,13 +38,21 @@ export default function Cache() { const { register, handleSubmit, + trigger, formState: {errors} } = useForm(); - const submit = e => { - e.preventDefault(); + const [showConfirmBox, setShowConfirm] = useState(false); + const showConfirmLog = () =>{ + trigger().then(valid => valid && setShowConfirm(true)); + }; + const cancelConfirmLog = ()=>{ + setShowConfirm(false); + }; + const submit = () => { handleSubmit(data=>{ deleteCache(data.path); })(); + setShowConfirm(false); }; return