diff --git a/LibationLauncher/LibationLauncher.csproj b/LibationLauncher/LibationLauncher.csproj index 9e8daf67..d973cd55 100644 --- a/LibationLauncher/LibationLauncher.csproj +++ b/LibationLauncher/LibationLauncher.csproj @@ -13,7 +13,7 @@ win-x64 - 5.1.4.1 + 5.1.5.1 diff --git a/LibationWinForms/Dialogs/Login/MfaDialog.cs b/LibationWinForms/Dialogs/Login/MfaDialog.cs index dac51ab4..9532c792 100644 --- a/LibationWinForms/Dialogs/Login/MfaDialog.cs +++ b/LibationWinForms/Dialogs/Login/MfaDialog.cs @@ -12,10 +12,14 @@ namespace LibationWinForms.Dialogs.Login { public partial class MfaDialog : Form { + private RadioButton[] radioButtons { get; } + public MfaDialog(AudibleApi.MfaConfig mfaConfig) { InitializeComponent(); + radioButtons = new[] { this.radioButton1, this.radioButton2, this.radioButton3 }; + // optional string settings if (!string.IsNullOrWhiteSpace(mfaConfig.Title)) this.Text = mfaConfig.Title; @@ -37,13 +41,21 @@ namespace LibationWinForms.Dialogs.Login radioButton3.Tag = mfaConfig.Button3Value; } + public string SelectedName { get; private set; } public string SelectedValue { get; private set; } private void submitBtn_Click(object sender, EventArgs e) { - var radioButtons = new[] { this.radioButton1, this.radioButton2, this.radioButton3 }; + Serilog.Log.Logger.Debug("RadioButton states: {@DebugInfo}", new { + rb1_checked = radioButton1.Checked, + r21_checked = radioButton2.Checked, + rb3_checked = radioButton3.Checked + }); + var selected = radioButtons.Single(rb => rb.Checked); + Serilog.Log.Logger.Debug("Selected: {@DebugInfo}", new { isSelected = selected is not null, name = selected?.Name, value = selected?.Tag }); + SelectedName = selected.Name; SelectedValue = (string)selected.Tag;