generated from Integry/Template_NetMauiBlazorHybrid
Fix caricamento post prima login
This commit is contained in:
@@ -175,9 +175,7 @@ public class ManageDataService(
|
|||||||
|
|
||||||
public async Task<List<ActivityDTO>> GetActivityTryLocalDb(WhereCondActivity whereCond)
|
public async Task<List<ActivityDTO>> GetActivityTryLocalDb(WhereCondActivity whereCond)
|
||||||
{
|
{
|
||||||
List<StbActivity>? activities;
|
var activities = await localDb.Get<StbActivity>(x =>
|
||||||
|
|
||||||
activities = await localDb.Get<StbActivity>(x =>
|
|
||||||
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
|
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
|
||||||
(whereCond.Start != null && whereCond.End != null && x.EffectiveTime == null &&
|
(whereCond.Start != null && whereCond.End != null && x.EffectiveTime == null &&
|
||||||
x.EstimatedTime >= whereCond.Start && x.EstimatedTime <= whereCond.End) ||
|
x.EstimatedTime >= whereCond.Start && x.EstimatedTime <= whereCond.End) ||
|
||||||
@@ -198,6 +196,7 @@ public class ManageDataService(
|
|||||||
|
|
||||||
_ = UpdateDb(activities);
|
_ = UpdateDb(activities);
|
||||||
}
|
}
|
||||||
|
else return [];
|
||||||
|
|
||||||
return await MapActivity(activities);
|
return await MapActivity(activities);
|
||||||
}
|
}
|
||||||
@@ -219,16 +218,7 @@ public class ManageDataService(
|
|||||||
|
|
||||||
_ = UpdateDb(activities);
|
_ = UpdateDb(activities);
|
||||||
}
|
}
|
||||||
else
|
else return await GetActivityTryLocalDb(whereCond);
|
||||||
{
|
|
||||||
activities = await localDb.Get<StbActivity>(x =>
|
|
||||||
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
|
|
||||||
(whereCond.Start != null && whereCond.End != null && x.EffectiveTime == null &&
|
|
||||||
x.EstimatedTime >= whereCond.Start && x.EstimatedTime <= whereCond.End) ||
|
|
||||||
(x.EffectiveTime >= whereCond.Start && x.EffectiveTime <= whereCond.End) ||
|
|
||||||
(whereCond.ActivityId == null && (whereCond.Start == null || whereCond.End == null))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return await MapActivity(activities);
|
return await MapActivity(activities);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -492,6 +492,8 @@
|
|||||||
// Selezione giorno in settimana
|
// Selezione giorno in settimana
|
||||||
private async Task SelezionaData(DateTime day)
|
private async Task SelezionaData(DateTime day)
|
||||||
{
|
{
|
||||||
|
if (IsLoading) return;
|
||||||
|
|
||||||
SelectedDate = day;
|
SelectedDate = day;
|
||||||
|
|
||||||
var cacheInternalMonth = _internalMonth;
|
var cacheInternalMonth = _internalMonth;
|
||||||
@@ -513,6 +515,8 @@
|
|||||||
// Selezione giorno dal mese (chiude la vista mese!)
|
// Selezione giorno dal mese (chiude la vista mese!)
|
||||||
private async Task SelezionaDataDalMese(DateTime day)
|
private async Task SelezionaDataDalMese(DateTime day)
|
||||||
{
|
{
|
||||||
|
if (IsLoading) return;
|
||||||
|
|
||||||
SelectedDate = day;
|
SelectedDate = day;
|
||||||
SliderAnimation = "collapse-animation";
|
SliderAnimation = "collapse-animation";
|
||||||
Expanded = false;
|
Expanded = false;
|
||||||
|
|||||||
@@ -15,12 +15,20 @@
|
|||||||
@inject PreloadService PreloadService
|
@inject PreloadService PreloadService
|
||||||
@inject IMessenger Messenger
|
@inject IMessenger Messenger
|
||||||
|
|
||||||
<SpinnerLayout FullScreen="true" />
|
<SpinnerLayout FullScreen="true"/>
|
||||||
|
|
||||||
@code
|
@code
|
||||||
{
|
{
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
var lastSyncDate = LocalStorage.Get<DateTime>("last-sync");
|
||||||
|
if (!FormFactor.IsWeb() && NetworkService.ConnectionAvailable && lastSyncDate.Equals(DateTime.MinValue))
|
||||||
|
{
|
||||||
|
var returnPath = System.Web.HttpUtility.UrlEncode("/");
|
||||||
|
NavigationManager.NavigateTo($"/sync?path={returnPath}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
NetworkService.ConnectionAvailable = NetworkService.IsNetworkAvailable();
|
NetworkService.ConnectionAvailable = NetworkService.IsNetworkAvailable();
|
||||||
|
|
||||||
await LoadNotification();
|
await LoadNotification();
|
||||||
@@ -35,14 +43,6 @@
|
|||||||
Console.WriteLine($"Firebase init: {e.Message}");
|
Console.WriteLine($"Firebase init: {e.Message}");
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastSyncDate = LocalStorage.Get<DateTime>("last-sync");
|
|
||||||
|
|
||||||
if (!FormFactor.IsWeb() && NetworkService.ConnectionAvailable && lastSyncDate.Equals(DateTime.MinValue))
|
|
||||||
{
|
|
||||||
NavigationManager.NavigateTo("/sync");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_ = StartSyncUser();
|
_ = StartSyncUser();
|
||||||
NavigationManager.NavigateTo("/Calendar");
|
NavigationManager.NavigateTo("/Calendar");
|
||||||
}
|
}
|
||||||
@@ -60,9 +60,6 @@
|
|||||||
|
|
||||||
private Task StartSyncUser()
|
private Task StartSyncUser()
|
||||||
{
|
{
|
||||||
return Task.Run(() =>
|
return Task.Run(() => { _ = PreloadService.PreloadUsersAsync(); });
|
||||||
{
|
|
||||||
_ = PreloadService.PreloadUsersAsync();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
{
|
{
|
||||||
<SpinnerLayout FullScreen="false"/>
|
<SpinnerLayout FullScreen="false"/>
|
||||||
}
|
}
|
||||||
else if (GroupedUserList?.Count > 0)
|
else if (GroupedUserList.IsNullOrEmpty() || FilteredGroupedUserList.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
<Virtualize OverscanCount="20" Items="FilteredGroupedUserList" Context="item">
|
<Virtualize OverscanCount="20" Items="FilteredGroupedUserList" Context="item">
|
||||||
@if (item.ShowHeader)
|
@if (item.ShowHeader)
|
||||||
|
|||||||
Reference in New Issue
Block a user