Skip to content

Commit

Permalink
fix: dialog for login doesn't close for NuGet servers if login fails,…
Browse files Browse the repository at this point in the history
… this closes #136

(cherry picked from commit bc214ae)
  • Loading branch information
iadonkey committed Jul 29, 2024
1 parent 018ec8a commit a3a80f5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions TwinpackShared/Protocol/Authentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,24 @@ public async Task LoginAsync(bool onlyTry = false, CancellationToken cancellatio
}
catch (Exception ex)
{
message = "Login to Twinpack Server failed!";
message = $@"Login to Twinpack Server failed, see '%LOCALAPPDATA%\Zeugwerk\logs\Twinpack' for details!";
_logger.Trace(ex);
_logger.Error(ex.Message);
}

if (!_packageServer.LoggedIn && _packageServer.UrlRegister != null)
if (!_packageServer.LoggedIn)
{
if (MessageBox.Show($@"{message} Do you want to register?", "Login failed", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
if (_packageServer.UrlRegister != null)
{
Process.Start(_packageServer.UrlRegister);
if (MessageBox.Show($"{message}\n\nDo you need to register?", "Login failed", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
Process.Start(_packageServer.UrlRegister);
else
return;
}
else
{
return;
if (MessageBox.Show($"{message}\n\nRetry?", "Login failed", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
return;
}
}
}
Expand Down

0 comments on commit a3a80f5

Please sign in to comment.