diff --git a/src/components/goals/NewGoalButton.tsx b/src/components/goals/NewGoalButton.tsx index 931596572..e618fdcee 100644 --- a/src/components/goals/NewGoalButton.tsx +++ b/src/components/goals/NewGoalButton.tsx @@ -7,6 +7,7 @@ import { GOAL_STATUS } from "@/lib/constants/statuses"; import { Field } from "@/components/ui/form"; import { ModalForm } from "@/components/ui/modal-form"; import { useCreateMutation } from "@/hooks/use-create-mutation"; +import { haptic } from "@/lib/haptics"; export function NewGoalButton({ goals }: { goals: GoalWithChildren[] }) { const [title, setTitle] = useState(""); @@ -22,12 +23,15 @@ export function NewGoalButton({ goals }: { goals: GoalWithChildren[] }) { setTitle(""); setDescription(""); setTargetDate(""); setParentGoalId(""); setError(null); }; - const onSubmit = () => create({ - title: title.trim(), - description: description.trim() || undefined, - targetDate: targetDate || undefined, - parentGoalId: parentGoalId || undefined, - }); + const onSubmit = () => { + haptic(); + return create({ + title: title.trim(), + description: description.trim() || undefined, + targetDate: targetDate || undefined, + parentGoalId: parentGoalId || undefined, + }); + }; // Flatten goal tree for parent selector (exclude completed goals) const flatGoals: Array<{ id: string; title: string; depth: number }> = []; diff --git a/src/components/money/NewSubscriptionButton.tsx b/src/components/money/NewSubscriptionButton.tsx index c93033d6c..3312b9f42 100644 --- a/src/components/money/NewSubscriptionButton.tsx +++ b/src/components/money/NewSubscriptionButton.tsx @@ -7,6 +7,7 @@ import { ModalForm } from "@/components/ui/modal-form"; import { useCreateMutation } from "@/hooks/use-create-mutation"; import { postJson } from "@/lib/api/fetch"; import type { CreateSubscriptionInput } from "@/db/queries/money"; +import { haptic } from "@/lib/haptics"; export function NewSubscriptionButton() { const [name, setName] = useState(""); @@ -28,16 +29,19 @@ export function NewSubscriptionButton() { setError(null); }; - const onSubmit = () => create({ - name: name.trim(), - vendor: vendor.trim() || undefined, - amount: amount ? parseFloat(amount) : undefined, - currency, - frequency, - nextDue: nextDue || undefined, - paymentMethod: paymentMethod.trim() || undefined, - notes: notes.trim() || undefined, - }); + const onSubmit = () => { + haptic(); + return create({ + name: name.trim(), + vendor: vendor.trim() || undefined, + amount: amount ? parseFloat(amount) : undefined, + currency, + frequency, + nextDue: nextDue || undefined, + paymentMethod: paymentMethod.trim() || undefined, + notes: notes.trim() || undefined, + }); + }; return (