From c7cc553e004581943a811a6445ac594a5267e87e Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Wed, 30 Dec 2020 12:08:26 +0100 Subject: [PATCH] fix debouncing called on pop --- example/lib/group_info_screen.dart | 8 +++++++- example/pubspec.yaml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/example/lib/group_info_screen.dart b/example/lib/group_info_screen.dart index 15ae0c10..1c926106 100644 --- a/example/lib/group_info_screen.dart +++ b/example/lib/group_info_screen.dart @@ -33,6 +33,9 @@ class _GroupInfoScreenState extends State { String changedName = ''; void _userNameListener() { + if (_searchController.text == _userNameQuery) { + return; + } if (_debounce?.isActive ?? false) _debounce.cancel(); _debounce = Timer(const Duration(milliseconds: 350), () { if (mounted && modalSetStateCallback != null) { @@ -492,7 +495,10 @@ class _GroupInfoScreenState extends State { r'$autocomplete': _userNameQuery, }, 'id': { - r'$ne': StreamChat.of(context).user.id, + r'$nin': [ + StreamChat.of(context).user.id, + ...channel.state.members.map((e) => e.userId), + ], }, }, sort: [ diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 4c5a590b..b4cbfad9 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,6 +1,6 @@ name: example description: A new Flutter project. -version: 1.0.95+98 +version: 1.0.96+99 environment: sdk: ">=2.2.2 <3.0.0"