From 56c373134fbd9b19de63b28c2a7e6c7f447ede7d Mon Sep 17 00:00:00 2001 From: Cinka Date: Sun, 7 Sep 2025 21:21:50 +0300 Subject: [PATCH] - fix: little thinks --- Nebula.Launcher/LauncherConVar.cs | 2 +- Nebula.Launcher/ViewModels/MainViewModel.cs | 46 ++++++++++++--------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/Nebula.Launcher/LauncherConVar.cs b/Nebula.Launcher/LauncherConVar.cs index d2a2644..6260913 100644 --- a/Nebula.Launcher/LauncherConVar.cs +++ b/Nebula.Launcher/LauncherConVar.cs @@ -48,7 +48,7 @@ public static class LauncherConVar public static readonly ConVar Hub = ConVarBuilder.Build("launcher.hub.v2", [ new ServerHubRecord("WizDen", "https://harpy.durenko.tatar/hub-api/api/servers"), - new ServerHubRecord("AltHub","https://web.networkgamez.com/api/servers") + new ServerHubRecord("AltHub","https://hub.singularity14.co.uk/api/servers") ]); public static readonly ConVar CurrentLang = ConVarBuilder.Build("launcher.language", CultureInfo.CurrentCulture.Name); diff --git a/Nebula.Launcher/ViewModels/MainViewModel.cs b/Nebula.Launcher/ViewModels/MainViewModel.cs index c100608..b09f8ce 100644 --- a/Nebula.Launcher/ViewModels/MainViewModel.cs +++ b/Nebula.Launcher/ViewModels/MainViewModel.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using System.Linq; +using Avalonia.Logging; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using Nebula.Launcher.Models; @@ -68,27 +69,13 @@ public partial class MainViewModel : ViewModelBase { AccountInfoViewModel.Credentials.PropertyChanged += (_, args) => { - if (args.PropertyName is not nameof(AccountInfoViewModel.Credentials.Value)) return; - - if(AccountInfoViewModel.Credentials.HasValue) - { - LoginText = - LocalisationService.GetString("auth-current-login-name", - new Dictionary - { - { "login", AccountInfoViewModel.Credentials.Value?.Login ?? "" }, - { - "auth_server", - AccountInfoViewModel.GetServerAuthName(AccountInfoViewModel.Credentials.Value) ?? "" - } - }); - } - else - { - LoginText = LocalisationService.GetString("auth-current-login-no-name"); - } + if (args.PropertyName is not nameof(AccountInfoViewModel.Credentials.Value)) + return; + UpdateCredentialsInfo(); }; + UpdateCredentialsInfo(); + _logger = DebugService.GetLogger(this); using var stream = typeof(MainViewModel).Assembly @@ -116,6 +103,27 @@ public partial class MainViewModel : ViewModelBase } } + private void UpdateCredentialsInfo() + { + if(AccountInfoViewModel.Credentials.HasValue) + { + LoginText = + LocalisationService.GetString("auth-current-login-name", + new Dictionary + { + { "login", AccountInfoViewModel.Credentials.Value?.Login ?? "" }, + { + "auth_server", + AccountInfoViewModel.GetServerAuthName(AccountInfoViewModel.Credentials.Value) ?? "" + } + }); + } + else + { + LoginText = LocalisationService.GetString("auth-current-login-no-name"); + } + } + private void CheckMigration() { if (!ConfigurationService.GetConfigValue(LauncherConVar.DoMigration))