From 1711993a297153710c4489075f9f2dae80619537 Mon Sep 17 00:00:00 2001 From: mrdeyroy Date: Thu, 21 May 2026 16:42:17 +0530 Subject: [PATCH 1/2] fix(ui): handle errors on goal deletion and show user feedback --- src/components/GoalTracker.tsx | 35 ++++++++-------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/src/components/GoalTracker.tsx b/src/components/GoalTracker.tsx index 36633792..cabaf067 100644 --- a/src/components/GoalTracker.tsx +++ b/src/components/GoalTracker.tsx @@ -96,16 +96,10 @@ export default function GoalTracker() { if (!res.ok) { setGoals(previousGoals); setDeleteError("Failed to delete goal. Please try again."); - setTimeout(() => { - setDeleteError(null); - }, 5000); } } catch { setGoals(previousGoals); - setDeleteError("Failed to delete goal. Please try again."); - setTimeout(() => { - setDeleteError(null); - }, 5000); + setDeleteError("Failed to delete goal. Please check your connection."); } finally { setDeletingId(null); } @@ -184,22 +178,9 @@ export default function GoalTracker() {

Weekly Goals

{deleteError && ( -
-
- - - - {deleteError} -
- +
+

{deleteError}

+
)} @@ -234,7 +215,7 @@ export default function GoalTracker() { )}
{completed && ( - + {completionLabel} )} @@ -283,7 +264,7 @@ export default function GoalTracker() { + )} @@ -264,7 +264,7 @@ export default function GoalTracker() {