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

Merge pull request 'fix autologin throwing error while off UI thread' (!29) from waffle.lord/Launcher:fix/autologin into master

Reviewed-on: SPT-AKI/Launcher#29
This commit is contained in:
IsWaffle 2023-11-16 23:30:04 +00:00
commit d32956ea36

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;
}