fix(inventory): recover from a stuck loading spinner

The inventory stream subscription had no onError handler, so a transient
failure at startup (e.g. the encrypted DB not yet ready) went unhandled
and left loading=true forever — the spinner that only a restart cleared.

Handle stream errors: drop out of loading, surface an error state, and
offer a retry that re-opens the stream. Add a _LoadError view (i18n en/
es/ast/pt) and cover both the failure and the retry-recovers paths.
This commit is contained in:
vjrj 2026-07-10 22:12:24 +02:00
parent bb4ee2fd89
commit f45c452615
12 changed files with 158 additions and 17 deletions

View file

@ -269,6 +269,8 @@ class _Translations$inventory$pt extends Translations$inventory$en {
@override String get clearFilters => 'Limpar filtros';
@override String get uncategorized => 'Sem categoria';
@override String get needsReproductionFilter => 'Para reproduzir';
@override String get loadError => 'Não foi possível abrir o teu banco de sementes. Talvez estivesse ocupado — tenta de novo.';
@override String get retry => 'Tentar de novo';
}
// Path: draft
@ -1248,6 +1250,8 @@ extension on TranslationsPt {
'inventory.clearFilters' => 'Limpar filtros',
'inventory.uncategorized' => 'Sem categoria',
'inventory.needsReproductionFilter' => 'Para reproduzir',
'inventory.loadError' => 'Não foi possível abrir o teu banco de sementes. Talvez estivesse ocupado — tenta de novo.',
'inventory.retry' => 'Tentar de novo',
'draft.capture' => 'Capturar fotos',
'draft.captured' => ({required Object n}) => '${n} capturadas para catalogar',
'draft.triageTitle' => 'Para catalogar',