From e06f2f47b18da9be2eac3b50ba14a4220a4a9c5d Mon Sep 17 00:00:00 2001 From: jaydeep-pipaliya <71074587+jaydeep-pipaliya@users.noreply.github.com> Date: Tue, 31 Mar 2026 11:48:56 +0530 Subject: [PATCH] fix: show contextual toast when saving with no targets Instead of always showing "Settings updated" when saving, show "Targets cleared" when the target list is empty. This gives the user accurate feedback without blocking the save action. Fixes #586 --- messages/en-US.json | 2 ++ .../settings/resources/proxy/[niceId]/proxy/page.tsx | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/messages/en-US.json b/messages/en-US.json index 895ee1332..478b64d44 100644 --- a/messages/en-US.json +++ b/messages/en-US.json @@ -568,6 +568,8 @@ "targetErrorInvalidPortDescription": "Please enter a valid port number", "targetErrorNoSite": "No site selected", "targetErrorNoSiteDescription": "Please select a site for the target", + "targetTargetsCleared": "Targets cleared", + "targetTargetsClearedDescription": "All targets have been removed from this resource", "targetCreated": "Target created", "targetCreatedDescription": "Target has been created successfully", "targetErrorCreate": "Failed to create target", diff --git a/src/app/[orgId]/settings/resources/proxy/[niceId]/proxy/page.tsx b/src/app/[orgId]/settings/resources/proxy/[niceId]/proxy/page.tsx index 51f11a2c3..795c9adf2 100644 --- a/src/app/[orgId]/settings/resources/proxy/[niceId]/proxy/page.tsx +++ b/src/app/[orgId]/settings/resources/proxy/[niceId]/proxy/page.tsx @@ -774,8 +774,12 @@ function ProxyResourceTargetsForm({ } toast({ - title: t("settingsUpdated"), - description: t("settingsUpdatedDescription") + title: targets.length === 0 + ? t("targetTargetsCleared") + : t("settingsUpdated"), + description: targets.length === 0 + ? t("targetTargetsClearedDescription") + : t("settingsUpdatedDescription") }); setTargetsToRemove([]);