mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-09 21:53:47 +00:00
Multiple Profiles can now be selected
This commit is contained in:
1 parent
d043fbc8f0
commit
cefc5464d5
89 files changed
+1360
-503
No files matched your search
@@ -33,6 +33,11 @@ public record ConfigMeta<TClass, TValue> : ConfigMetaBase
|
||||
/// </summary>
|
||||
public required TValue Default { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether a managed user-value snapshot may restore JSON null for this setting.
|
||||
/// </summary>
|
||||
public bool AllowNullSnapshot { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The additive value contributions, one per contributing configuration plugin.
|
||||
/// </summary>
|
||||
@@ -70,10 +75,10 @@ public record ConfigMeta<TClass, TValue> : ConfigMetaBase
|
||||
try
|
||||
{
|
||||
var value = JsonSerializer.Deserialize<TValue>(json, SettingsManager.JSON_OPTIONS);
|
||||
if (value is null)
|
||||
if (value is null && !this.AllowNullSnapshot)
|
||||
return false;
|
||||
|
||||
this.SetValue(value);
|
||||
this.SetValue(value!);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -116,4 +121,4 @@ public record ConfigMeta<TClass, TValue> : ConfigMetaBase
|
||||
|
||||
return default!;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user