mirror of
https://github.com/JuniorDark/RustyHearts-Launcher.git
synced 2026-05-07 05:21:44 -04:00
Fix bug related to collection modification during Application.Restart() on ChangePassword.
This commit is contained in:
parent
46b2b6f15d
commit
d5ec712d0f
3 changed files with 26 additions and 15 deletions
|
|
@ -62,6 +62,8 @@ namespace RHLauncher
|
|||
}
|
||||
|
||||
private void HandleSendEmailResponse(string response)
|
||||
{
|
||||
Invoke((MethodInvoker)(() =>
|
||||
{
|
||||
switch (response)
|
||||
{
|
||||
|
|
@ -103,21 +105,24 @@ namespace RHLauncher
|
|||
MsgBoxForm.Show("Error:" + response, LocalizedStrings.Error);
|
||||
break;
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private void ResendTimer_Tick(object? sender, EventArgs e)
|
||||
{
|
||||
// Decrement the secondsLeft variable and update the button text
|
||||
secondsLeft--;
|
||||
Invoke((MethodInvoker)(() =>
|
||||
{
|
||||
TimerLabel.Text = $"({secondsLeft})";
|
||||
|
||||
// If the timer has finished counting down, stop the timer and enable the ResendEmailButton
|
||||
if (secondsLeft == 0)
|
||||
{
|
||||
resendTimer.Stop();
|
||||
SendEmailButton.Enabled = true;
|
||||
TimerLabel.Text = "";
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private async Task<string> VerifyCodeSendRequestAsync()
|
||||
|
|
@ -155,11 +160,12 @@ namespace RHLauncher
|
|||
registryHandler = new RegistryHandler();
|
||||
registryHandler.ClearPassword();
|
||||
|
||||
Invoke((MethodInvoker)(() => Close()));
|
||||
Application.Restart();
|
||||
}
|
||||
else
|
||||
{
|
||||
Close();
|
||||
Invoke((MethodInvoker)(() => Close()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -460,19 +460,24 @@ namespace RHLauncher
|
|||
|
||||
public void Logout()
|
||||
{
|
||||
LoginForm? loginForm = Application.OpenForms.OfType<LoginForm>().FirstOrDefault();
|
||||
LoginForm loginForm = Application.OpenForms.OfType<LoginForm>().FirstOrDefault();
|
||||
if (loginForm != null)
|
||||
{
|
||||
// Close the current form before restarting
|
||||
Close();
|
||||
|
||||
// Restart the application
|
||||
Application.Restart();
|
||||
}
|
||||
else
|
||||
{
|
||||
LoginForm newLoginForm = new();
|
||||
LoginForm newLoginForm = new LoginForm();
|
||||
newLoginForm.Show();
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async void UpdateCheckButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
HidePanels();
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
<AssemblyName>Launcher</AssemblyName>
|
||||
<Description>Rusty Hearts Launcher</Description>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<AssemblyVersion>1.0.2</AssemblyVersion>
|
||||
<FileVersion>1.0.2</FileVersion>
|
||||
<AssemblyVersion>1.0.3</AssemblyVersion>
|
||||
<FileVersion>1.0.3</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue