diff --git a/lib/features/base/mixin/auto_complete_result_mixin.dart b/lib/features/base/mixin/auto_complete_result_mixin.dart index 9119bd85a..cb3649861 100644 --- a/lib/features/base/mixin/auto_complete_result_mixin.dart +++ b/lib/features/base/mixin/auto_complete_result_mixin.dart @@ -15,9 +15,13 @@ mixin AutoCompleteResultMixin { FutureOr> handleAutoCompleteResultState({ required Either resultState, required String queryString, + Function(Failure failure)? onFailureCallback, }) { return resultState.fold( - (failure) => [], + (failure) { + onFailureCallback?.call(failure); + return []; + }, (success) => handleAutoCompleteSuccess(success, queryString) ); } diff --git a/lib/features/composer/presentation/composer_controller.dart b/lib/features/composer/presentation/composer_controller.dart index 49b267f8c..5286df0d0 100644 --- a/lib/features/composer/presentation/composer_controller.dart +++ b/lib/features/composer/presentation/composer_controller.dart @@ -1005,6 +1005,7 @@ class ComposerController extends BaseController .then((value) => handleAutoCompleteResultState( resultState: value, queryString: queryString, + onFailureCallback: (failure) => consumeState(Stream.value(Left(failure))), ) ); } else if (_getDeviceContactSuggestionsInteractor != null) { @@ -1024,6 +1025,7 @@ class ComposerController extends BaseController .then((value) => handleAutoCompleteResultState( resultState: value, queryString: queryString, + onFailureCallback: (failure) => consumeState(Stream.value(Left(failure))), ) ) ?? []; } diff --git a/lib/features/contact/presentation/contact_controller.dart b/lib/features/contact/presentation/contact_controller.dart index 60d66abca..373ece43a 100644 --- a/lib/features/contact/presentation/contact_controller.dart +++ b/lib/features/contact/presentation/contact_controller.dart @@ -175,6 +175,7 @@ class ContactController extends BaseController with AutoCompleteResultMixin { .then((value) => handleAutoCompleteResultState( resultState: value, queryString: queryString, + onFailureCallback: (failure) => consumeState(Stream.value(Left(failure))), ) ); } else if (_getDeviceContactSuggestionsInteractor != null) { @@ -194,6 +195,7 @@ class ContactController extends BaseController with AutoCompleteResultMixin { .then((value) => handleAutoCompleteResultState( resultState: value, queryString: queryString, + onFailureCallback: (failure) => consumeState(Stream.value(Left(failure))), ) ) ?? []; }