TF-3408 Remove limit result in autocomplete
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user