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:
@@ -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" : "")}";
|
||||
|
||||
Reference in New Issue
Block a user