- tweak: UI improvement
This commit is contained in:
@@ -115,7 +115,7 @@ public partial class MainViewModel : ViewModelBase
|
||||
PopupMessage(@base);
|
||||
break;
|
||||
case Exception error:
|
||||
var err = ViewHelperService.GetViewModel<ExceptionViewModel>();
|
||||
var err = ViewHelperService.GetViewModel<ExceptionListViewModel>();
|
||||
DebugService.Error(error);
|
||||
err.AppendError(error);
|
||||
PopupMessage(err);
|
||||
|
||||
@@ -24,6 +24,7 @@ public partial class ServerListViewModel : ViewModelBase, IViewModelPage
|
||||
[ObservableProperty] private bool _isFavoriteMode;
|
||||
|
||||
public ObservableCollection<ServerEntryModelView> Servers { get; }= new();
|
||||
public ObservableCollection<Exception> HubErrors { get; } = new();
|
||||
|
||||
public Action? OnSearchChange;
|
||||
[GenerateProperty] private HubService HubService { get; }
|
||||
@@ -40,6 +41,7 @@ public partial class ServerListViewModel : ViewModelBase, IViewModelPage
|
||||
protected override void InitialiseInDesignMode()
|
||||
{
|
||||
ServerViewContainer = new ServerViewContainer(this, RestService, CancellationService, DebugService, ViewHelperService);
|
||||
HubErrors.Add(new Exception("UVI"));
|
||||
}
|
||||
|
||||
//real think
|
||||
@@ -51,12 +53,18 @@ public partial class ServerListViewModel : ViewModelBase, IViewModelPage
|
||||
|
||||
HubService.HubServerChangedEventArgs += HubServerChangedEventArgs;
|
||||
HubService.HubServerLoaded += UpdateServerEntries;
|
||||
HubService.HubServerLoadingError += HubServerLoadingError;
|
||||
OnSearchChange += OnChangeSearch;
|
||||
|
||||
if (!HubService.IsUpdating) UpdateServerEntries();
|
||||
UpdateFavoriteEntries();
|
||||
}
|
||||
|
||||
private void HubServerLoadingError(Exception obj)
|
||||
{
|
||||
HubErrors.Add(obj);
|
||||
}
|
||||
|
||||
private void UpdateServerEntries()
|
||||
{
|
||||
Servers.Clear();
|
||||
@@ -120,6 +128,7 @@ public partial class ServerListViewModel : ViewModelBase, IViewModelPage
|
||||
|
||||
public void UpdateRequired()
|
||||
{
|
||||
HubErrors.Clear();
|
||||
Task.Run(HubService.UpdateHub);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ using Nebula.Shared.Services;
|
||||
|
||||
namespace Nebula.Launcher.ViewModels.Popup;
|
||||
|
||||
[ViewModelRegister(typeof(ExceptionView), false)]
|
||||
[ViewModelRegister(typeof(ExceptionListView), false)]
|
||||
[ConstructGenerator]
|
||||
public sealed partial class ExceptionViewModel : PopupViewModelBase
|
||||
public sealed partial class ExceptionListViewModel : PopupViewModelBase
|
||||
{
|
||||
[GenerateProperty] public override PopupMessageService PopupMessageService { get; }
|
||||
public override string Title => "Oopsie! Some shit is happened now!";
|
||||
@@ -281,6 +281,7 @@ public partial class ServerEntryModelView : ViewModelBase
|
||||
Description = info.Desc;
|
||||
|
||||
Links.Clear();
|
||||
if(info.Links is null) return;
|
||||
foreach (var link in info.Links)
|
||||
{
|
||||
Links.Add(link);
|
||||
|
||||
Reference in New Issue
Block a user