0
0
mirror of https://github.com/sp-tarkov/launcher.git synced 2025-02-12 16:50:43 -05:00

fix autologin throwing error while off UI thread

This commit is contained in:
IsWaffle 2023-11-16 18:25:09 -05:00
parent 72d8a66df5
commit 724744b9f6

View File

@ -11,6 +11,7 @@ using Splat;
using System.Collections.ObjectModel;
using System.Reactive;
using System.Threading.Tasks;
using Avalonia.Threading;
namespace Aki.Launcher.ViewModels
{
@ -111,12 +112,11 @@ namespace Aki.Launcher.ViewModels
//handle auto-login
if (LauncherSettingsProvider.Instance.UseAutoLogin && LauncherSettingsProvider.Instance.Server.AutoLoginCreds != null && !NoAutoLogin)
{
Task.Run(() =>
Login = LauncherSettingsProvider.Instance.Server.AutoLoginCreds;
Dispatcher.UIThread.InvokeAsync(() =>
{
Login = LauncherSettingsProvider.Instance.Server.AutoLoginCreds;
LoginCommand.Execute();
});
return;
}