- add: ServerLink think

This commit is contained in:
2025-01-27 15:55:30 +03:00
parent 1374772d46
commit e1657d9234
12 changed files with 143 additions and 39 deletions

View File

@@ -1,5 +1,7 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
@@ -75,24 +77,29 @@ public partial class AccountInfoViewModel : ViewModelBase
DoAuth();
}
public async void DoAuth()
public void DoAuth()
{
var message = ViewHelperService.GetViewModel<InfoPopupViewModel>();
message.InfoText = "Auth think, please wait...";
message.IsInfoClosable = false;
Console.WriteLine("AUTH SHIT");
PopupMessageService.Popup(message);
if (await AuthService.Auth(CurrentAlp))
Task.Run(async () =>
{
message.Dispose();
IsLogged = true;
ConfigurationService.SetConfigValue(CurrentConVar.AuthCurrent, CurrentAlp);
}
else
{
message.Dispose();
Logout();
PopupMessageService.Popup("Well, shit is happened: " + AuthService.Reason);
}
if (await AuthService.Auth(CurrentAlp))
{
message.Dispose();
IsLogged = true;
ConfigurationService.SetConfigValue(CurrentConVar.AuthCurrent, CurrentAlp);
}
else
{
message.Dispose();
Logout();
PopupMessageService.Popup("Well, shit is happened: " + AuthService.Reason);
}
});
}
public void Logout()