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:
Marc-André Bombeck committed 2026-07-31 21:17:01 +02:00
1 parent 88162eda07
commit 84706196dd
1 file changed
+3 -1
+3 -1
View File
@@ -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)) {