Fix defaultAIModel deserialization and serialization

Corrects the deserialization of defaultAIModel to ensure it is properly converted from dynamic to Map<String, Object?>. Also fixes a typo in the serialization key from 'defaultLLMSaveObject' to 'defaultAIModel'.
This commit is contained in:
Ankit Mahato
2025-08-29 02:21:27 +05:30
parent 63fc31589d
commit 7216697897

View File

@@ -145,7 +145,9 @@ class SettingsModel {
final workspaceFolderPath = data["workspaceFolderPath"] as String?;
final isSSLDisabled = data["isSSLDisabled"] as bool?;
final isDashBotEnabled = data["isDashBotEnabled"] as bool?;
final defaultAIModel = data["defaultAIModel"] as Map<String, Object?>?;
final defaultAIModel = data["defaultAIModel"] == null
? null
: Map<String, Object?>.from(data["defaultAIModel"]);
const sm = SettingsModel();
return sm.copyWith(
@@ -184,7 +186,7 @@ class SettingsModel {
"workspaceFolderPath": workspaceFolderPath,
"isSSLDisabled": isSSLDisabled,
"isDashBotEnabled": isDashBotEnabled,
'defaultLLMSaveObject': defaultAIModel,
"defaultAIModel": defaultAIModel,
};
}