TF-3408 Remove limit result in autocomplete

This commit is contained in:
dab246
2025-01-15 04:27:49 +07:00
committed by Dat H. Pham
parent 840645b8f1
commit b73784742a
13 changed files with 100 additions and 39 deletions
@@ -229,16 +229,22 @@ class EmailRecoveryController extends BaseController with DateRangePickerMixin {
hasAttachment.value = value ?? false;
}
Future<List<EmailAddress>> getAutoCompleteSuggestion(String word) async {
Future<List<EmailAddress>> getAutoCompleteSuggestion(String word, {int? limit}) async {
log('EmailRecoveryController::getAutoCompleteSuggestion(): $word | $_contactSuggestionSource');
_getAllAutoCompleteInteractor = getBinding<GetAllAutoCompleteInteractor>();
_getAutoCompleteInteractor = getBinding<GetAutoCompleteInteractor>();
_getDeviceContactSuggestionsInteractor = getBinding<GetDeviceContactSuggestionsInteractor>();
final autoCompletePattern = AutoCompletePattern(
word: word,
limit: limit,
accountId: _accountId
);
if (_contactSuggestionSource == ContactSuggestionSource.all) {
if (_getAllAutoCompleteInteractor != null) {
return await _getAllAutoCompleteInteractor!
.execute(AutoCompletePattern(word: word, accountId: _accountId))
.execute(autoCompletePattern)
.then((value) => value.fold(
(failure) => <EmailAddress>[],
(success) => success is GetAutoCompleteSuccess
@@ -247,7 +253,7 @@ class EmailRecoveryController extends BaseController with DateRangePickerMixin {
));
} else if (_getDeviceContactSuggestionsInteractor != null) {
return await _getDeviceContactSuggestionsInteractor!
.execute(AutoCompletePattern(word: word, accountId: _accountId))
.execute(autoCompletePattern)
.then((value) => value.fold(
(failure) => <EmailAddress>[],
(success) => success is GetDeviceContactSuggestionsSuccess
@@ -262,7 +268,7 @@ class EmailRecoveryController extends BaseController with DateRangePickerMixin {
return <EmailAddress>[];
} else {
return await _getAutoCompleteInteractor!
.execute(AutoCompletePattern(word: word, accountId: _accountId))
.execute(autoCompletePattern)
.then((value) => value.fold(
(failure) => <EmailAddress>[],
(success) => success is GetAutoCompleteSuccess