From 6f842a3de7d98baae44f8debf49a0b9965479230 Mon Sep 17 00:00:00 2001 From: Weixuan Fu Date: Wed, 7 Feb 2024 21:35:08 +0800 Subject: [PATCH] add delete confirm prompt --- ui/src/App.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 99068bb..f023ec2 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -80,8 +80,14 @@ export default function App() { }, []); const deleteCurWorkflow = async () => { if (curFlowID.current) { - await workflowsTable?.delete(curFlowID.current); - setCurFlowIDAndName(null, ""); + const userInput = confirm( + "Are you sure you want to delete this workflow?", + ); + if (userInput) { + // User clicked OK + await workflowsTable?.delete(curFlowID.current); + setCurFlowIDAndName(null, ""); + } } };