Fixed bug with wrong update messages

This commit is contained in:
Alexander 2019-11-24 09:34:52 +02:00
parent 4b87b4cfe6
commit ee36ea1ae6

View file

@ -277,7 +277,7 @@ private async Task CheckForUpdates(bool autoCheck)
{
using (new CenterWinDialog(this))
{
DialogResult res = MessageBox.Show(this, "New version is available. Install it now?", PublicVar.appName,
DialogResult res = MessageBox.Show(this, "New version is available. Install it now?", PublicVar.appName,
MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (res == DialogResult.Yes)
{
@ -311,21 +311,19 @@ private async Task CheckForUpdates(bool autoCheck)
{
if (autoCheck)
{
mainMenu.Invoke((Action)delegate
using (new CenterWinDialog(this))
{
using (new CenterWinDialog(this))
if (statusPanel.Visible)
{
if (statusPanel.Visible)
{
StatusPanelMessage("update-failed");
}
else
{
MessageBox.Show(this, "Checking for updates failed:\nConnection lost or the server is busy.", PublicVar.appName,
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
StatusPanelMessage("update-failed");
}
});
else
{
MessageBox.Show(this, "Checking for updates failed:\nConnection lost or the server is busy.", PublicVar.appName,
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
}