From 48c5d756127d7b0289e1aaa10e62eb093af1caa9 Mon Sep 17 00:00:00 2001 From: viplmad <39457122+viplmad@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:40:38 +0100 Subject: [PATCH] Fix label and unnecessary loading indicator --- lib/l10n/app_en.arb | 1 + lib/l10n/app_es.arb | 1 + lib/ui/detail/item_detail.dart | 2 +- lib/ui/relation/item_relation.dart | 2 +- logic/lib/bloc/item_detail/item_detail_bloc.dart | 12 +++++++----- logic/lib/bloc/item_detail/item_detail_event.dart | 14 +++++++++++++- 6 files changed, 24 insertions(+), 8 deletions(-) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 2f9e53f..7b4282c 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -4,6 +4,7 @@ "connectString": "Connect", "failedConnectionString": "Failed connection", "retryString": "Retry", + "reloadString": "Reload", "changeRepositoryString": "Change connection settings", "changeStartGameViewString": "Change start Game View", "startGameViewString": "Start Game View", diff --git a/lib/l10n/app_es.arb b/lib/l10n/app_es.arb index ea4428e..b46647a 100644 --- a/lib/l10n/app_es.arb +++ b/lib/l10n/app_es.arb @@ -4,6 +4,7 @@ "connectString": "Conectar", "failedConnectionString": "Conexión fallida", "retryString": "Reintentar", + "reloadString": "Recargar", "changeRepositoryString": "Cambiar ajustes de conexión", "changeStartGameViewString": "Cambiar vista de juegos inicial", "startGameViewString": "Vista de juegos inicial", diff --git a/lib/ui/detail/item_detail.dart b/lib/ui/detail/item_detail.dart index ca96742..ff106f0 100644 --- a/lib/ui/detail/item_detail.dart +++ b/lib/ui/detail/item_detail.dart @@ -193,7 +193,7 @@ abstract class ItemDetailBody< } void reloadItem(BuildContext context) { - BlocProvider.of(context).add(ReloadItem()); + BlocProvider.of(context).add(const ReloadItem()); reloadExtraFields(context); } diff --git a/lib/ui/relation/item_relation.dart b/lib/ui/relation/item_relation.dart index 9eea2e3..718d58a 100644 --- a/lib/ui/relation/item_relation.dart +++ b/lib/ui/relation/item_relation.dart @@ -262,7 +262,7 @@ class _RelationList extends StatelessWidget { text: headerText, trailingWidget: IconButton( icon: const Icon(Icons.refresh), - tooltip: AppLocalizations.of(context)!.retryString, + tooltip: AppLocalizations.of(context)!.reloadString, onPressed: reload, ), ), diff --git a/logic/lib/bloc/item_detail/item_detail_bloc.dart b/logic/lib/bloc/item_detail/item_detail_bloc.dart index 44ed278..e30b820 100644 --- a/logic/lib/bloc/item_detail/item_detail_bloc.dart +++ b/logic/lib/bloc/item_detail/item_detail_bloc.dart @@ -44,9 +44,11 @@ abstract class ItemDetailBloc emit, ) async { if (state is ItemLoaded) { - emit( - ItemLoading(), - ); + if (!event.silent) { + emit( + ItemLoading(), + ); + } await _mapAnyLoadToState(emit); } else if (state is! ItemLoading) { @@ -85,11 +87,11 @@ abstract class ItemDetailBloc get props => [silent]; + + @override + String toString() => 'ReloadItem { ' + 'silent: $silent' + ' }'; +}