summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorKurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>2025-12-06 23:52:24 -0500
committerGitHub <noreply@github.com>2025-12-06 23:52:24 -0500
commit0752e8eba063d8d2a694a5b99637615e9cbffbf1 (patch)
tree4176c752516ebdb7a4a8841dbe29adee7d6c5774 /src/components
parent4e2eb1a8c0d118938d68c82dcad13ab743658a0b (diff)
parentc6d990dadb251e85cc4f98f1546115c146c6705a (diff)
downloaddecky-lsfg-vk-0752e8eba063d8d2a694a5b99637615e9cbffbf1.tar.gz
decky-lsfg-vk-0752e8eba063d8d2a694a5b99637615e9cbffbf1.zip
Merge pull request #201 from xXJSONDeruloXx/profile-normalize
fix: normalize spaces in profile names w dashes for conf requirements…
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ProfileManagement.tsx16
1 files changed, 10 insertions, 6 deletions
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");