summaryrefslogtreecommitdiff
path: root/src/hooks/useProfileManagement.ts
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2025-12-06 23:40:32 -0500
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2025-12-06 23:40:32 -0500
commita4b6f610ca0d2cf73ccbc40c5d9d5b1cc9c629b9 (patch)
treed2bc9dc5838ff2f8d8032c12c6cb7ba927155589 /src/hooks/useProfileManagement.ts
parent56c493184fc3960e3b33aa789fad618962c339ae (diff)
downloaddecky-lsfg-vk-a4b6f610ca0d2cf73ccbc40c5d9d5b1cc9c629b9.tar.gz
decky-lsfg-vk-a4b6f610ca0d2cf73ccbc40c5d9d5b1cc9c629b9.zip
fix: normalize spaces in profile names w dashes for conf requirements, display actual in FE
Diffstat (limited to 'src/hooks/useProfileManagement.ts')
-rw-r--r--src/hooks/useProfileManagement.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/hooks/useProfileManagement.ts b/src/hooks/useProfileManagement.ts
index 4b10f0e..a5f2a07 100644
--- a/src/hooks/useProfileManagement.ts
+++ b/src/hooks/useProfileManagement.ts
@@ -46,7 +46,9 @@ export function useProfileManagement() {
try {
const result: ProfileResult = await createProfile(profileName, sourceProfile || currentProfile);
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();
return result;
} else {
@@ -106,11 +108,13 @@ export function useProfileManagement() {
try {
const result: ProfileResult = await renameProfile(oldName, 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();
// Update current profile if it was renamed
if (currentProfile === oldName) {
- setCurrentProfileState(newName);
+ setCurrentProfileState(actualNewName);
}
return result;
} else {