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
This commit is contained in:
jaydeep-pipaliya
2026-03-31 11:48:56 +05:30
parent e345c6ee6e
commit e06f2f47b1
2 changed files with 8 additions and 2 deletions

View File

@@ -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([]);