diff --git a/SteUp.Shared/Components/Pages/LoginPage.razor b/SteUp.Shared/Components/Pages/LoginPage.razor index a3d1b10..1f9f011 100644 --- a/SteUp.Shared/Components/Pages/LoginPage.razor +++ b/SteUp.Shared/Components/Pages/LoginPage.razor @@ -86,6 +86,7 @@ else try { + SteupDataService.RegisterAppVersion(); await UserAccountService.Login(UserData.Username, UserData.Password, UserData.CodHash); AuthenticationStateProvider.NotifyAuthenticationState(); //Chiamato per forzare il refresh await SteupDataService.Init(); diff --git a/SteUp.Shared/Core/Data/Contracts/ISteupDataService.cs b/SteUp.Shared/Core/Data/Contracts/ISteupDataService.cs index b059a55..d6a1414 100644 --- a/SteUp.Shared/Core/Data/Contracts/ISteupDataService.cs +++ b/SteUp.Shared/Core/Data/Contracts/ISteupDataService.cs @@ -6,6 +6,7 @@ namespace SteUp.Shared.Core.Data.Contracts; public interface ISteupDataService { Task Init(); + void RegisterAppVersion(); List PuntiVenditaList { get; } InspectionPageState InspectionPageState { get; set; } diff --git a/SteUp.Shared/Core/Data/SteupDataService.cs b/SteUp.Shared/Core/Data/SteupDataService.cs index cafb44c..985341c 100644 --- a/SteUp.Shared/Core/Data/SteupDataService.cs +++ b/SteUp.Shared/Core/Data/SteupDataService.cs @@ -1,21 +1,33 @@ using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account; +using IntegryApiClient.Core.Domain.Abstraction.Contracts.Device; using SteUp.Shared.Core.Data.Contracts; using SteUp.Shared.Core.Dto; using SteUp.Shared.Core.Dto.PageState; using SteUp.Shared.Core.Interface.IntegryApi; using SteUp.Shared.Core.Interface.LocalDb; +using SteUp.Shared.Core.Interface.System; namespace SteUp.Shared.Core.Data; public class SteupDataService( IIntegrySteupService integrySteupService, IUserSession userSession, + IDeviceService deviceService, + IGenericSystemService genericSystemService, IDbInitializer dbInitializer) : ISteupDataService { public async Task Init() { await dbInitializer.InitializeAsync(); await LoadDataAsync(); + RegisterAppVersion(); + } + + public void RegisterAppVersion() + { + deviceService.RegisterAppVersion( + genericSystemService.GetCurrentAppVersion() + ); } private async Task LoadDataAsync()