MCPcopy Create free account
hub / github.com/continuedev/continue / handleSubmit

Function handleSubmit

gui/src/components/dialogs/AddRuleDialog.tsx:30–55  ·  view source on GitHub ↗
(e: React.FormEvent)

Source from the content-addressed store, hash-verified

28 };
29
30 const handleSubmit = (e: React.FormEvent) => {
31 e.preventDefault();
32 const trimmed = name.trim();
33 if (!trimmed) {
34 setError("Rule name is required");
35 return;
36 }
37 setError(undefined);
38 setIsSubmitting(true);
39 try {
40 if (mode === "global") {
41 ideMessenger.post("config/addGlobalRule", {
42 baseFilename: trimmed,
43 });
44 } else {
45 ideMessenger.post("config/addLocalWorkspaceBlock", {
46 blockType: "rules",
47 baseFilename: trimmed,
48 });
49 }
50 closeDialog();
51 } catch (err) {
52 setIsSubmitting(false);
53 setError("Failed to create rule file");
54 }
55 };
56
57 const title = mode === "global" ? "Add global rule" : "Add workspace rule";
58

Callers

nothing calls this directly

Calls 2

closeDialogFunction · 0.70
postMethod · 0.65

Tested by

no test coverage detected