Merge pull request #51 from aariste/master

Fix 2LCS closing when cookie is expired
This commit is contained in:
Tomek Melissa 2020-03-25 17:22:59 +01:00 коммит произвёл GitHub
Родитель 9a7cbd0441 d39660c8a3
Коммит b37365dccd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -1417,7 +1417,7 @@ namespace LCS.Forms
logoutToolStripMenuItem.Enabled = true;
loginToLcsMenuItem.Enabled = false;
ChangeProjectMenuItem_Click(null, null);
}
}
private void LogonToApplicationToolStripMenuItem_Click(object sender, EventArgs e)
{

Просмотреть файл

@ -1,5 +1,6 @@
using LCS.Forms;
using System;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;
@ -12,6 +13,7 @@ namespace LCS
switch (e.Exception.Source)
{
case "System.Net.Http" when e.Exception.Message == $"Response status code does not indicate success: 498 ().":
case "mscorlib" when e.Exception.InnerException.Message == $"Response status code does not indicate success: 498 ().":
MessageBox.Show("Please login to LCS again. Your cookie is probably invalid or expired.");
var mainForm = GetMainForm();
mainForm.Cursor = Cursors.Default;
@ -39,6 +41,11 @@ namespace LCS
{
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
if (Debugger.IsAttached)
{
Properties.Settings.Default.Reset();
}
// Copy user settings from previous application version if necessary
if (Properties.Settings.Default.update)
{