summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2025-08-16 12:17:21 -0400
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2025-08-16 12:17:21 -0400
commit5c3cd5d0dc620a64b13475c7daa5638ddcb061bb (patch)
treee2620ca3fcd3c3f39217b0c32834c3aa2fc6ba89
parent4104e28053fc03b3875958c7bf56ec6fbc5aab84 (diff)
downloaddecky-lsfg-vk-5c3cd5d0dc620a64b13475c7daa5638ddcb061bb.tar.gz
decky-lsfg-vk-5c3cd5d0dc620a64b13475c7daa5638ddcb061bb.zip
fix unique prof creation in conf
-rw-r--r--py_modules/lsfg_vk/config_schema.py8
-rw-r--r--src/components/Content.tsx10
2 files changed, 12 insertions, 6 deletions
diff --git a/py_modules/lsfg_vk/config_schema.py b/py_modules/lsfg_vk/config_schema.py
index 60e54e0..8027bc1 100644
--- a/py_modules/lsfg_vk/config_schema.py
+++ b/py_modules/lsfg_vk/config_schema.py
@@ -213,7 +213,11 @@ class ConfigurationManager:
lines.append("")
# Add game sections for each profile
- for profile_name, config in profile_data["profiles"].items():
+ # Sort profiles to ensure consistent order (default profile first)
+ sorted_profiles = sorted(profile_data["profiles"].items(),
+ key=lambda x: (x[0] != DEFAULT_PROFILE_NAME, x[0]))
+
+ for profile_name, config in sorted_profiles:
lines.append("[[game]]")
if profile_name == DEFAULT_PROFILE_NAME:
lines.append("# Plugin-managed game entry (default profile)")
@@ -228,7 +232,7 @@ class ConfigurationManager:
if field_name in GLOBAL_SECTION_FIELDS:
continue
- value = config[field_name]
+ value = config.get(field_name, field_def.default)
# Add field description comment
lines.append(f"# {field_def.description}")
diff --git a/src/components/Content.tsx b/src/components/Content.tsx
index c7c757b..d823257 100644
--- a/src/components/Content.tsx
+++ b/src/components/Content.tsx
@@ -50,11 +50,13 @@ export function Content() {
// If we have a current profile, update that profile specifically
if (currentProfile) {
const newConfig = { ...config, [fieldName]: value };
- await updateProfileConfig(currentProfile, newConfig);
- // Also update local config state
- await updateField(fieldName, value);
+ const result = await updateProfileConfig(currentProfile, newConfig);
+ if (result.success) {
+ // Reload config to reflect the changes from the backend
+ await loadLsfgConfig();
+ }
} else {
- // Fallback to the original method
+ // Fallback to the original method for backward compatibility
await updateField(fieldName, value);
}
};