From 86a4b52053e7cc106d5e98f74bd71b9829161c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 9 May 2026 02:09:57 +0200 Subject: [PATCH] fix(admin): danger-zone result colour driven by mutation state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P18. Replace the brittle "wipeMsg.startsWith(localized prefix)" success heuristic with React Query's `wipeAllData.isError` flag. The previous heuristic (a) re-formatted the success copy with empty placeholders to extract a prefix, (b) string-prefix-matched against the rendered message, and (c) silently broke whenever the i18n copy changed colon position or got translated. Now the colour follows the mutation state directly: error → destructive, success → dracula-green. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/admin/danger-zone-section.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/admin/danger-zone-section.tsx b/src/components/admin/danger-zone-section.tsx index abcd06b18..8aef558c3 100644 --- a/src/components/admin/danger-zone-section.tsx +++ b/src/components/admin/danger-zone-section.tsx @@ -113,7 +113,9 @@ export function DangerZoneSection({ id }: { id: string }) { {wipeMsg && (

{wipeMsg}