mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Fix and derequire type text in confirmation
Even if we have it always available, we don't need use it 99.9% of time, and even in 0.1% it's only supportive attribute for debugging. Make it optional, will help with robustness.
This commit is contained in:
@@ -36,9 +36,8 @@ public sealed class Confirmation {
|
||||
public EConfirmationType ConfirmationType { get; private init; }
|
||||
|
||||
[JsonInclude]
|
||||
[JsonPropertyName("type_text")]
|
||||
[JsonRequired]
|
||||
public string ConfirmationTypeText { get; private init; } = "";
|
||||
[JsonPropertyName("type_name")]
|
||||
public string? ConfirmationTypeName { get; private init; }
|
||||
|
||||
[JsonInclude]
|
||||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
|
||||
|
||||
@@ -183,7 +183,7 @@ public sealed class MobileAuthenticator : IDisposable {
|
||||
}
|
||||
|
||||
foreach (Confirmation? confirmation in response.Confirmations.Where(static confirmation => (confirmation.ConfirmationType == Confirmation.EConfirmationType.Unknown) || !Enum.IsDefined(confirmation.ConfirmationType))) {
|
||||
Bot.ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, Strings.WarningUnknownValuePleaseReport, nameof(confirmation.ConfirmationType), $"{confirmation.ConfirmationType} ({confirmation.ConfirmationTypeText})"));
|
||||
Bot.ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, Strings.WarningUnknownValuePleaseReport, nameof(confirmation.ConfirmationType), $"{confirmation.ConfirmationType} ({confirmation.ConfirmationTypeName ?? "null"})"));
|
||||
}
|
||||
|
||||
return response.Confirmations;
|
||||
|
||||
Reference in New Issue
Block a user