- add: some logging think
This commit is contained in:
@@ -12,6 +12,7 @@ using Nebula.Launcher.ViewModels.Popup;
|
||||
using Nebula.Launcher.Views.Pages;
|
||||
using Nebula.Shared;
|
||||
using Nebula.Shared.Services;
|
||||
using Nebula.Shared.Services.Logging;
|
||||
using Nebula.Shared.Utils;
|
||||
|
||||
namespace Nebula.Launcher.ViewModels.Pages;
|
||||
@@ -37,6 +38,7 @@ public partial class AccountInfoViewModel : ViewModelBase, IViewModelPage
|
||||
private bool _isProfilesEmpty;
|
||||
[GenerateProperty] private PopupMessageService PopupMessageService { get; } = default!;
|
||||
[GenerateProperty] private ConfigurationService ConfigurationService { get; } = default!;
|
||||
[GenerateProperty] private DebugService DebugService { get; }
|
||||
[GenerateProperty] private AuthService AuthService { get; } = default!;
|
||||
[GenerateProperty, DesignConstruct] private ViewHelperService ViewHelperService { get; } = default!;
|
||||
|
||||
@@ -45,6 +47,8 @@ public partial class AccountInfoViewModel : ViewModelBase, IViewModelPage
|
||||
|
||||
[ObservableProperty] private AuthServerCredentials _authItemSelect;
|
||||
|
||||
private ILogger _logger;
|
||||
|
||||
//Design think
|
||||
protected override void InitialiseInDesignMode()
|
||||
{
|
||||
@@ -57,6 +61,7 @@ public partial class AccountInfoViewModel : ViewModelBase, IViewModelPage
|
||||
//Real think
|
||||
protected override void Initialise()
|
||||
{
|
||||
_logger = DebugService.GetLogger(this);
|
||||
ReadAuthConfig();
|
||||
}
|
||||
|
||||
@@ -121,7 +126,6 @@ public partial class AccountInfoViewModel : ViewModelBase, IViewModelPage
|
||||
}
|
||||
catch (AuthException e)
|
||||
{
|
||||
|
||||
switch (e.Error.Code)
|
||||
{
|
||||
case AuthenticateDenyCode.TfaRequired:
|
||||
@@ -129,9 +133,11 @@ public partial class AccountInfoViewModel : ViewModelBase, IViewModelPage
|
||||
var p = ViewHelperService.GetViewModel<TfaViewModel>();
|
||||
p.OnTfaEntered += OnTfaEntered;
|
||||
PopupMessageService.Popup(p);
|
||||
_logger.Log("TFA required");
|
||||
break;
|
||||
case AuthenticateDenyCode.InvalidCredentials:
|
||||
PopupMessageService.Popup("Invalid Credentials!");
|
||||
_logger.Error($"Invalid credentials");
|
||||
break;
|
||||
default:
|
||||
throw;
|
||||
|
||||
@@ -160,7 +160,6 @@ public partial class ServerEntryModelView : ViewModelBase
|
||||
MainViewModel.RequirePage<ContentBrowserViewModel>().Go(Address.ToString(), new ContentPath());
|
||||
}
|
||||
|
||||
|
||||
public void ToggleFavorites()
|
||||
{
|
||||
OnFavoriteToggle?.Invoke();
|
||||
@@ -228,9 +227,11 @@ public partial class ServerEntryModelView : ViewModelBase
|
||||
|
||||
Process.Exited += OnExited;
|
||||
}
|
||||
catch (TaskCanceledException)
|
||||
catch (TaskCanceledException e)
|
||||
{
|
||||
PopupMessageService.Popup("Task canceled");
|
||||
PopupMessageService.Popup("Task canceled: " + e.Message);
|
||||
_logger.Error("Task canceled");
|
||||
_logger.Error(e);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user