From 5513ba4c2db05de40d9adfac645d7e77c35c71f7 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 4 Dec 2018 14:11:29 +0200 Subject: Worked on PPC setup & update. --- Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs index 5598362be..281e54958 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs @@ -74,10 +74,12 @@ namespace Tango.PPC.UI.ViewModels { using (ObservablesContext db = ObservablesContext.CreateDefault()) { - if (db.Users.Count() == 1) + var machine = await db.Machines.FirstAsync(); + + if (db.Users.Count() == 1 || machine.AutoLogin) { var user = await db.Users.FirstAsync(); - LogManager.Log($"Application started. Single user detected ({user.Email}). Skipping LoginView..."); + LogManager.Log($"Application started. Single user/Auto login detected ({user.Email}). Skipping LoginView..."); await AuthenticationProvider.Login(user.Email, user.Password, false); IsLoading = false; } -- cgit v1.3.1