Skip to content
Snippets Groups Projects
Commit 86e4abc7 authored by vjrj's avatar vjrj
Browse files

Search in contacts too

parent 0d5fdad7
No related branches found
No related tags found
No related merge requests found
...@@ -46,13 +46,17 @@ class _PayContactSearchPageState extends State<PayContactSearchPage> { ...@@ -46,13 +46,17 @@ class _PayContactSearchPageState extends State<PayContactSearchPage> {
setState(() { setState(() {
_isLoading = true; _isLoading = true;
}); });
final ContactsCubit contactsCubit = context.read<ContactsCubit>();
final Response cPlusResponse = await searchCPlusUser(_searchTerm);
setState(() { setState(() {
_results = <Contact>[]; _results = contactsCubit.search(_searchTerm);
if (inDevelopment) {
logger('Found: ${_results.length} in contacts');
}
}); });
final Response cPlusResponse = await searchCPlusUser(_searchTerm);
if (cPlusResponse.statusCode != 404) { if (cPlusResponse.statusCode != 404) {
setState(() { setState(() {
// Add cplus users // Add cplus users
...@@ -185,7 +189,7 @@ class _PayContactSearchPageState extends State<PayContactSearchPage> { ...@@ -185,7 +189,7 @@ class _PayContactSearchPageState extends State<PayContactSearchPage> {
}, },
), ),
if (_isLoading) if (_isLoading)
const LoadingBox() const LoadingBox(simple: false)
else if (_searchTerm.isNotEmpty && _results.isEmpty && _isLoading) else if (_searchTerm.isNotEmpty && _results.isEmpty && _isLoading)
const NoElements(text: 'nothing_found') const NoElements(text: 'nothing_found')
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment