Fusionner le cache hors-ligne IndexedDB

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

# Conflicts:
#	MaBibli.Client/wwwroot/css/app.css
This commit is contained in:
mathieu
2026-08-18 14:06:07 +02:00
22 changed files with 1573 additions and 84 deletions
+20 -2
View File
@@ -1,5 +1,7 @@
@page "/auteurs"
@inject ServiceLivresApi Api
@inject EtatReseau Reseau
@implements IDisposable
<PageTitle>MaBibli — auteurs</PageTitle>
@@ -37,11 +39,14 @@
</p>
<div class="actions-formulaire">
<button type="button" class="bouton bouton-principal" disabled="@_enCours"
@* Une fusion est une écriture : elle demande le réseau, comme le reste. *@
<button type="button" class="bouton bouton-principal"
disabled="@(_enCours || !Reseau.EnLigne)" title="@MotifBlocage"
@onclick="() => AccepterAsync(suggestion)">
Oui, réunir sous « @suggestion.Cible.Nom »
</button>
<button type="button" class="bouton bouton-discret" disabled="@_enCours"
<button type="button" class="bouton bouton-discret"
disabled="@(_enCours || !Reseau.EnLigne)" title="@MotifBlocage"
@onclick="() => RefuserAsync(suggestion)">
Non, deux personnes
</button>
@@ -90,6 +95,19 @@ else
private bool _enCours;
private string? _erreur;
protected override void OnInitialized() => Reseau.Change += SurChangementReseau;
private void SurChangementReseau() => _ = InvokeAsync(async () =>
{
await ChargerAsync();
StateHasChanged();
});
public void Dispose() => Reseau.Change -= SurChangementReseau;
/// <summary>Raison du blocage des fusions, ou <c>null</c> en ligne.</summary>
private string? MotifBlocage => Reseau.EnLigne ? null : EtatReseau.MotifHorsLigne;
protected override Task OnInitializedAsync() => ChargerAsync();
private static string Livres(int nombre) => $"{nombre} livre{(nombre > 1 ? "s" : "")}";