From ccf56b8dbbe4d4c4c9575a8ee542fc1cbcc4801a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 4 Jun 2026 18:32:09 +0200 Subject: [PATCH] fix(mood): surface a toast when a list delete fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mood list delete mutation had no onError handler, so a rejected DELETE cleared no state and showed nothing — the row stayed in place with no signal the request was refused. Add an error toast on failure, mirroring the medication-card silent-failure fix. --- src/components/mood/mood-list.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/mood/mood-list.tsx b/src/components/mood/mood-list.tsx index cabaee497..aeff2d266 100644 --- a/src/components/mood/mood-list.tsx +++ b/src/components/mood/mood-list.tsx @@ -63,6 +63,7 @@ import { } from "lucide-react"; import { useId, useState } from "react"; import { createPortal } from "react-dom"; +import { toast } from "sonner"; import { formatDateTime } from "@/lib/format"; import { useTranslations, useFormatters } from "@/lib/i18n/context"; import { @@ -206,6 +207,13 @@ export function MoodList({ onAddFirst }: MoodListProps = {}) { onSuccess: () => { void invalidateKeys(queryClient, moodDependentKeys); }, + // v1.11.5 — a failed delete used to fail silently (no onError handler), + // leaving the row in place with no signal that the request was rejected. + // Surface the failure so the user knows to retry. Mirrors the v1.11.3 + // medication-card silent-failure fix. + onError: () => { + toast.error(t("mood.deleteError")); + }, }); const updateMutation = useMutation({