add delete confirm prompt

This commit is contained in:
Weixuan Fu
2024-02-07 21:35:08 +08:00
parent d3462cd040
commit 6f842a3de7
+8 -2
View File
@@ -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, "");
}
}
};