mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
Let the score settings announce a save the way every other surface does
The new page wrote its own success toast. The outcome module owns that affordance so a saved thing looks the same everywhere, and a structural check catches anyone reaching around it. That check offers an allowlist entry as a way out; taking it would have left two places deciding what a success looks like, which is the thing the module exists to prevent.
This commit is contained in:
1 parent
88162eda07
commit
84706196dd
1 file changed
+3
-1
@@ -43,6 +43,8 @@ import { useMemo, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { toast } from "sonner";
|
||||
|
||||
import { toastWrittenOutcome } from "@/components/outcome/outcome-toast";
|
||||
import { Gauge, Loader2 } from "lucide-react";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -206,7 +208,7 @@ export function ScoreSection() {
|
||||
queryKey: queryKeys.dashboardSnapshot(),
|
||||
});
|
||||
void queryClient.invalidateQueries({ queryKey: queryKeys.dailyDigest() });
|
||||
toast.success(t("settings.sections.score.saved"));
|
||||
toastWrittenOutcome("success", t("settings.sections.score.saved"));
|
||||
},
|
||||
onError: (err) => {
|
||||
if (isConflict(err)) {
|
||||
|
||||
Reference in new issue
Block a user