From a4b6f610ca0d2cf73ccbc40c5d9d5b1cc9c629b9 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Sat, 6 Dec 2025 23:40:32 -0500 Subject: fix: normalize spaces in profile names w dashes for conf requirements, display actual in FE --- src/components/ProfileManagement.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/components') diff --git a/src/components/ProfileManagement.tsx b/src/components/ProfileManagement.tsx index 62160d9..73a40c7 100644 --- a/src/components/ProfileManagement.tsx +++ b/src/components/ProfileManagement.tsx @@ -217,10 +217,12 @@ export function ProfileManagement({ currentProfile, onProfileChange }: ProfileMa try { const result: ProfileResult = await createProfile(profileName, selectedProfile); if (result.success) { - showSuccessToast("Profile created", `Created profile: ${profileName}`); + // Use the normalized name returned from backend (spaces converted to dashes) + const actualProfileName = result.profile_name || profileName; + showSuccessToast("Profile created", `Created profile: ${actualProfileName}`); await loadProfiles(); - // Automatically switch to the newly created profile - await handleProfileChange(profileName); + // Automatically switch to the newly created profile using the normalized name + await handleProfileChange(actualProfileName); } else { console.error("Failed to create profile:", result.error); showErrorToast("Failed to create profile", result.error || "Unknown error"); @@ -307,10 +309,12 @@ export function ProfileManagement({ currentProfile, onProfileChange }: ProfileMa try { const result: ProfileResult = await renameProfile(selectedProfile, newName); if (result.success) { - showSuccessToast("Profile renamed", `Renamed profile to: ${newName}`); + // Use the normalized name returned from backend (spaces converted to dashes) + const actualNewName = result.profile_name || newName; + showSuccessToast("Profile renamed", `Renamed profile to: ${actualNewName}`); await loadProfiles(); - setSelectedProfile(newName); - onProfileChange?.(newName); + setSelectedProfile(actualNewName); + onProfileChange?.(actualNewName); } else { console.error("Failed to rename profile:", result.error); showErrorToast("Failed to rename profile", result.error || "Unknown error"); -- cgit v1.2.3