Skip to content

Commit

Permalink
Merge pull request #675 from breez/ok300-recover-screen-improvements
Browse files Browse the repository at this point in the history
Recover screen fixes
  • Loading branch information
ok300 authored Oct 12, 2023
2 parents f63e7da + e57958f commit 14a54d4
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class RestoreFormPageState extends State<RestoreForm> {
validator: (text) => _onValidate(context, text!),
suggestionsCallback: _getSuggestions,
hideOnEmpty: true,
hideOnLoading: true,
autoFlipDirection: true,
suggestionsBoxDecoration: const SuggestionsBoxDecoration(
color: Colors.white,
Expand Down Expand Up @@ -120,7 +121,11 @@ class RestoreFormPageState extends State<RestoreForm> {
}

FutureOr<List<String>> _getSuggestions(pattern) {
var suggestionList = WORDLIST.where((item) => item.startsWith(pattern)).toList();
return suggestionList.isNotEmpty ? suggestionList : List.empty();
if (pattern.toString().isEmpty) {
return List.empty();
} else {
var suggestionList = WORDLIST.where((item) => item.startsWith(pattern)).toList();
return suggestionList.isNotEmpty ? suggestionList : List.empty();
}
}
}

0 comments on commit 14a54d4

Please sign in to comment.